bcdice 3.1.3 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -2
  3. data/i18n/StellarKnights/ja_jp.yml +496 -0
  4. data/lib/bcdice/common_command/add_dice.rb +1 -1
  5. data/lib/bcdice/common_command/calc.rb +1 -1
  6. data/lib/bcdice/dice_table.rb +2 -0
  7. data/lib/bcdice/dice_table/d66_half_grid_table.rb +33 -0
  8. data/lib/bcdice/dice_table/d66_one_third_table.rb +34 -0
  9. data/lib/bcdice/game_system.rb +3 -0
  10. data/lib/bcdice/game_system/AceKillerGene.rb +1 -1
  11. data/lib/bcdice/game_system/Ainecadette.rb +68 -0
  12. data/lib/bcdice/game_system/Airgetlamh.rb +1 -1
  13. data/lib/bcdice/game_system/Alsetto.rb +1 -1
  14. data/lib/bcdice/game_system/AlterRaise.rb +2 -2
  15. data/lib/bcdice/game_system/AngelGear.rb +1 -1
  16. data/lib/bcdice/game_system/AnimaAnimus.rb +1 -1
  17. data/lib/bcdice/game_system/Arianrhod.rb +6 -8
  18. data/lib/bcdice/game_system/Avandner.rb +1 -1
  19. data/lib/bcdice/game_system/BarnaKronika.rb +1 -1
  20. data/lib/bcdice/game_system/BattleTech.rb +1 -1
  21. data/lib/bcdice/game_system/BeginningIdol.rb +5 -5
  22. data/lib/bcdice/game_system/BeginningIdol_Korean.rb +5 -5
  23. data/lib/bcdice/game_system/BladeOfArcana.rb +1 -1
  24. data/lib/bcdice/game_system/BlindMythos.rb +1 -1
  25. data/lib/bcdice/game_system/BloodCrusade.rb +6 -7
  26. data/lib/bcdice/game_system/BloodMoon.rb +9 -8
  27. data/lib/bcdice/game_system/CardRanker.rb +8 -7
  28. data/lib/bcdice/game_system/ChaosFlare.rb +21 -15
  29. data/lib/bcdice/game_system/Chill.rb +10 -10
  30. data/lib/bcdice/game_system/Chill3.rb +9 -9
  31. data/lib/bcdice/game_system/CrashWorld.rb +1 -1
  32. data/lib/bcdice/game_system/Cthulhu.rb +1 -1
  33. data/lib/bcdice/game_system/Cthulhu7th.rb +48 -10
  34. data/lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb +1 -1
  35. data/lib/bcdice/game_system/Cthulhu7th_Korean.rb +1 -1
  36. data/lib/bcdice/game_system/DarkBlaze.rb +0 -11
  37. data/lib/bcdice/game_system/DarkDaysDrive.rb +8 -7
  38. data/lib/bcdice/game_system/DeadlineHeroes.rb +2 -2
  39. data/lib/bcdice/game_system/DemonParasite.rb +5 -13
  40. data/lib/bcdice/game_system/DesperateRun.rb +1 -1
  41. data/lib/bcdice/game_system/DoubleCross.rb +1 -1
  42. data/lib/bcdice/game_system/Dracurouge.rb +1 -1
  43. data/lib/bcdice/game_system/EclipsePhase.rb +14 -14
  44. data/lib/bcdice/game_system/Elric.rb +18 -14
  45. data/lib/bcdice/game_system/Elysion.rb +1 -1
  46. data/lib/bcdice/game_system/EmbryoMachine.rb +9 -8
  47. data/lib/bcdice/game_system/Emoklore.rb +3 -3
  48. data/lib/bcdice/game_system/Fiasco.rb +1 -1
  49. data/lib/bcdice/game_system/FilledWith.rb +4 -0
  50. data/lib/bcdice/game_system/GURPS.rb +17 -28
  51. data/lib/bcdice/game_system/Garako.rb +1 -1
  52. data/lib/bcdice/game_system/GardenOrder.rb +1 -1
  53. data/lib/bcdice/game_system/GeishaGirlwithKatana.rb +1 -1
  54. data/lib/bcdice/game_system/GoblinSlayer.rb +1 -1
  55. data/lib/bcdice/game_system/Gorilla.rb +2 -8
  56. data/lib/bcdice/game_system/GranCrest.rb +18 -11
  57. data/lib/bcdice/game_system/Gundog.rb +9 -8
  58. data/lib/bcdice/game_system/GundogRevised.rb +10 -9
  59. data/lib/bcdice/game_system/GundogZero.rb +1 -1
  60. data/lib/bcdice/game_system/GurpsFW.rb +16 -16
  61. data/lib/bcdice/game_system/HarnMaster.rb +19 -26
  62. data/lib/bcdice/game_system/HatsuneMiku.rb +1 -1
  63. data/lib/bcdice/game_system/Hieizan.rb +12 -21
  64. data/lib/bcdice/game_system/HouraiGakuen.rb +1 -1
  65. data/lib/bcdice/game_system/HuntersMoon.rb +5 -10
  66. data/lib/bcdice/game_system/InfiniteFantasia.rb +19 -17
  67. data/lib/bcdice/game_system/Insane.rb +13 -20
  68. data/lib/bcdice/game_system/IthaWenUa.rb +8 -15
  69. data/lib/bcdice/game_system/JamesBond.rb +10 -10
  70. data/lib/bcdice/game_system/JekyllAndHyde.rb +1 -1
  71. data/lib/bcdice/game_system/Kamigakari.rb +1 -1
  72. data/lib/bcdice/game_system/KanColle.rb +4 -9
  73. data/lib/bcdice/game_system/KemonoNoMori.rb +1 -1
  74. data/lib/bcdice/game_system/KillDeathBusiness.rb +7 -15
  75. data/lib/bcdice/game_system/KurayamiCrying.rb +55 -2
  76. data/lib/bcdice/game_system/MeikyuDays.rb +10 -8
  77. data/lib/bcdice/game_system/MeikyuKingdom.rb +26 -26
  78. data/lib/bcdice/game_system/MeikyuKingdomBasic.rb +3 -3
  79. data/lib/bcdice/game_system/MetalHead.rb +12 -22
  80. data/lib/bcdice/game_system/MetalHeadExtream.rb +5 -5
  81. data/lib/bcdice/game_system/MonotoneMuseum.rb +8 -6
  82. data/lib/bcdice/game_system/Nechronica.rb +28 -21
  83. data/lib/bcdice/game_system/NinjaSlayer.rb +4 -4
  84. data/lib/bcdice/game_system/NjslyrBattle.rb +8 -11
  85. data/lib/bcdice/game_system/OneWayHeroics.rb +1 -1
  86. data/lib/bcdice/game_system/Paradiso.rb +1 -1
  87. data/lib/bcdice/game_system/ParasiteBlood.rb +1 -1
  88. data/lib/bcdice/game_system/Peekaboo.rb +4 -9
  89. data/lib/bcdice/game_system/Pendragon.rb +7 -7
  90. data/lib/bcdice/game_system/PhantasmAdventure.rb +8 -8
  91. data/lib/bcdice/game_system/Postman.rb +1 -1
  92. data/lib/bcdice/game_system/PulpCthulhu.rb +1 -1
  93. data/lib/bcdice/game_system/Raisondetre.rb +2 -2
  94. data/lib/bcdice/game_system/Revulture.rb +123 -0
  95. data/lib/bcdice/game_system/RuneQuest.rb +8 -8
  96. data/lib/bcdice/game_system/Ryutama.rb +1 -1
  97. data/lib/bcdice/game_system/Satasupe.rb +1 -1
  98. data/lib/bcdice/game_system/ScreamHighSchool.rb +2 -2
  99. data/lib/bcdice/game_system/SharedFantasia.rb +19 -23
  100. data/lib/bcdice/game_system/ShinobiGami.rb +14 -6
  101. data/lib/bcdice/game_system/Skynauts.rb +2 -2
  102. data/lib/bcdice/game_system/SkynautsBouken.rb +228 -0
  103. data/lib/bcdice/game_system/StellarKnights.rb +59 -696
  104. data/lib/bcdice/game_system/SterileLife.rb +1 -1
  105. data/lib/bcdice/game_system/StratoShout.rb +8 -16
  106. data/lib/bcdice/game_system/Strave.rb +1 -1
  107. data/lib/bcdice/game_system/SwordWorld.rb +16 -7
  108. data/lib/bcdice/game_system/SwordWorld2_0.rb +2 -2
  109. data/lib/bcdice/game_system/SwordWorld2_5.rb +2 -2
  110. data/lib/bcdice/game_system/TherapieSein.rb +1 -1
  111. data/lib/bcdice/game_system/TokyoGhostResearch.rb +1 -1
  112. data/lib/bcdice/game_system/TrinitySeven.rb +4 -4
  113. data/lib/bcdice/game_system/TunnelsAndTrolls.rb +1 -1
  114. data/lib/bcdice/game_system/Utakaze.rb +1 -1
  115. data/lib/bcdice/game_system/Villaciel.rb +1 -1
  116. data/lib/bcdice/game_system/WARPS.rb +11 -9
  117. data/lib/bcdice/game_system/WaresBlade.rb +4 -9
  118. data/lib/bcdice/game_system/Warhammer.rb +15 -6
  119. data/lib/bcdice/game_system/Warhammer4.rb +15 -11
  120. data/lib/bcdice/game_system/WitchQuest.rb +1 -1
  121. data/lib/bcdice/game_system/YankeeYogSothoth.rb +4 -9
  122. data/lib/bcdice/game_system/meikyu_kingdom_basic/kingdom_table.rb +1 -1
  123. data/lib/bcdice/game_system/sword_world/rating_parsed.rb +4 -4
  124. data/lib/bcdice/game_system/sword_world/rating_parser.rb +1 -1
  125. data/lib/bcdice/game_system/sword_world/transcendent_test.rb +26 -8
  126. data/lib/bcdice/repl.rb +1 -1
  127. data/lib/bcdice/result.rb +26 -0
  128. data/lib/bcdice/version.rb +1 -1
  129. metadata +9 -4
@@ -100,7 +100,7 @@ module BCDice
100
100
  )
101
101
  }.freeze
102
102
 
103
- register_prefix('RC\d+', 'DDC', TABLES.keys)
103
+ register_prefix('RC', 'DDC', TABLES.keys)
104
104
 
105
105
  def initialize(command)
106
106
  super(command)
@@ -239,7 +239,7 @@ module BCDice
239
239
  end
240
240
 
241
241
  # 疾風怒濤式の成功判定コマンドの正規表現マッチ情報からノードを作る
242
- # @param [MatchData] m 正規表現のマッチ情報
242
+ # @param command [String]
243
243
  # @return [DX]
244
244
  def parse_dx_shippu_doto(command)
245
245
  parser = Command::Parser.new(/\d+DX\d*/, round_type: round_type)
@@ -548,7 +548,7 @@ module BCDice
548
548
 
549
549
  TABLES = translate_tables(:ja_jp)
550
550
 
551
- register_prefix('DR', 'RT', 'HRT', 'CT\d+', TABLES.keys)
551
+ register_prefix('DR', 'RT', 'HRT', 'CT', TABLES.keys)
552
552
  end
553
553
  end
554
554
  end
@@ -16,34 +16,34 @@ module BCDice
16
16
  HELP_MESSAGE =
17
17
  '1D100<=m 方式の判定で成否、クリティカル・ファンブルを自動判定'
18
18
 
19
- def check_1D100(total, _dice_total, cmp_op, target)
20
- return '' if target == '?'
21
- return '' unless cmp_op == :<=
19
+ def result_1d100(total, _dice_total, cmp_op, target)
20
+ return nil if target == '?'
21
+ return nil unless cmp_op == :<=
22
22
 
23
- diceValue = total % 100 # 出目00は100ではなく00とする
24
- dice_ten_place = diceValue / 10
25
- dice_one_place = diceValue % 10
23
+ dice_value = total % 100 # 出目00は100ではなく00とする
24
+ dice_ten_place = dice_value / 10
25
+ dice_one_place = dice_value % 10
26
26
 
27
27
  if dice_ten_place == dice_one_place
28
- return '決定的失敗' if diceValue == 99
29
- return '00 > 決定的成功' if diceValue == 0
30
- return '決定的成功' if total <= target
28
+ return Result.fumble('決定的失敗') if dice_value == 99
29
+ return Result.critical('00 > 決定的成功') if dice_value == 0
30
+ return Result.critical('決定的成功') if total <= target
31
31
 
32
- return '決定的失敗'
32
+ return Result.fumble('決定的失敗')
33
33
  end
34
34
 
35
35
  diff_threshold = 30
36
36
 
37
37
  if total <= target
38
38
  if total >= diff_threshold
39
- 'エクセレント'
39
+ Result.success('エクセレント')
40
40
  else
41
- '成功'
41
+ Result.success('成功')
42
42
  end
43
43
  elsif (total - target) >= diff_threshold
44
- 'シビア'
44
+ Result.failure('シビア')
45
45
  else
46
- '失敗'
46
+ Result.failure('失敗')
47
47
  end
48
48
  end
49
49
  end
@@ -16,20 +16,24 @@ module BCDice
16
16
  HELP_MESSAGE = "貫通、クリティカル、ファンブルの自動判定を行います。\n"
17
17
 
18
18
  # ゲーム別成功度判定(1d100)
19
- def check_1D100(total, _dice_total, cmp_op, target)
20
- return '' if target == '?'
21
- return '' unless cmp_op == :<=
22
-
23
- # 1は常に貫通
24
- return " > 貫通" if total <= 1
25
- # 100は常に致命的失敗
26
- return " 致命的失敗" if total >= 100
27
-
28
- return " > 決定的成功" if total <= (target / 5 + 0.9)
29
- return " > 成功" if total <= target
30
- return " > 致命的失敗" if (total >= 99) && (target < 100)
31
-
32
- return " 失敗"
19
+ def result_1d100(total, _dice_total, cmp_op, target)
20
+ return nil unless cmp_op == :<=
21
+
22
+ if total <= 1
23
+ Result.critical("貫通") # 1は常に貫通
24
+ elsif total >= 100
25
+ Result.fumble("致命的失敗") # 100は常に致命的失敗
26
+ elsif target == '?'
27
+ Result.nothing
28
+ elsif total <= (target / 5.0).ceil
29
+ Result.critical("決定的成功")
30
+ elsif total <= target
31
+ Result.success("成功")
32
+ elsif (total >= 99) && (target < 100)
33
+ Result.fumble("致命的失敗")
34
+ else
35
+ Result.failure("失敗")
36
+ end
33
37
  end
34
38
  end
35
39
  end
@@ -1205,7 +1205,7 @@ module BCDice
1205
1205
  'RBT', 'SBT', 'BBT', 'CBT', 'DBT', 'IBT', 'FBT', 'LBT', 'PBT', 'NBT', 'ABT', 'VBT', 'GBT', 'HBT',
1206
1206
  'BFT', 'FWT', 'FT',
1207
1207
  'SRT', 'ORT', 'DRT', 'URT',
1208
- 'NJ\d+', 'BS\d+', TABLES.keys
1208
+ 'NJ', 'BS', TABLES.keys
1209
1209
  )
1210
1210
  end
1211
1211
  end
@@ -24,7 +24,7 @@ module BCDice
24
24
   ・射撃攻撃ファンブル表 SFT
25
25
  INFO_MESSAGE_TEXT
26
26
 
27
- register_prefix('EM\d+', 'HLT', 'MFT', 'SFT', '2R10')
27
+ register_prefix('EM', 'HLT', 'MFT', 'SFT', '2R10')
28
28
 
29
29
  def initialize(command)
30
30
  super(command)
@@ -45,18 +45,19 @@ module BCDice
45
45
  end
46
46
 
47
47
  # ゲーム別成功度判定(nD10)
48
- def check_nD10(total, dice_total, _dice_list, cmp_op, target)
49
- return '' if target == '?'
50
- return '' unless cmp_op == :>=
48
+ def result_nd10(total, dice_total, _dice_list, cmp_op, target)
49
+ return nil unless cmp_op == :>=
51
50
 
52
51
  if dice_total <= 2
53
- "ファンブル"
52
+ Result.fumble("ファンブル")
54
53
  elsif dice_total >= 20
55
- "クリティカル"
54
+ Result.critical("クリティカル")
55
+ elsif target == "?"
56
+ Result.nothing
56
57
  elsif total >= target
57
- "成功"
58
+ Result.success("成功")
58
59
  else
59
- "失敗"
60
+ Result.failure("失敗")
60
61
  end
61
62
  end
62
63
 
@@ -7,13 +7,13 @@ module BCDice
7
7
  ID = "Emoklore"
8
8
 
9
9
  # ゲームシステム名
10
- NAME = "エモクロア"
10
+ NAME = "エモクロアTRPG"
11
11
 
12
12
  # ゲームシステム名の読みがな
13
13
  #
14
14
  # 「ゲームシステム名の読みがなの設定方法」(docs/dicebot_sort_key.md)を参考にして
15
15
  # 設定してください
16
- SORT_KEY = "えもくろあ"
16
+ SORT_KEY = "えもくろあTRPG"
17
17
 
18
18
  # ダイスボットの使い方
19
19
  HELP_MESSAGE = <<~MESSAGETEXT
@@ -30,7 +30,7 @@ module BCDice
30
30
  MESSAGETEXT
31
31
 
32
32
  # ダイスボットで使用するコマンドを配列で列挙する
33
- register_prefix('\d*DM<=\d+', '(B|\d*)DA\d+')
33
+ register_prefix('\d*DM<=', '(B|\d*)DA')
34
34
 
35
35
  CRITICAL_VALUE = 1
36
36
  FUMBLE_VALUE = 10
@@ -20,7 +20,7 @@ module BCDice
20
20
  ※ WとBは片方指定(Bx, Wx)、入替指定(WxBx,BxWx)可能
21
21
  INFO_MESSAGE_TEXT
22
22
 
23
- register_prefix('FS\d+', '[WB]\d+')
23
+ register_prefix('FS', 'W', 'B')
24
24
 
25
25
  def eval_game_system_specific_command(command)
26
26
  roll_fs(command) || roll_white_black(command) || roll_white_black_single(command)
@@ -121,6 +121,10 @@ module BCDice
121
121
  class FW
122
122
  attr_accessor :dice_count, :target, :critical, :fumble
123
123
 
124
+ def initialize
125
+ @target = nil
126
+ end
127
+
124
128
  def self.roll(command, randomizer)
125
129
  fw = parse(command)
126
130
 
@@ -32,7 +32,7 @@ module BCDice
32
32
  ・D66ダイスあり
33
33
  INFO_MESSAGE_TEXT
34
34
 
35
- register_prefix('FEAR(\+?\d+)?', 'REACT((\+|\-)?\d*)', '[\d\+\-]+\-3D6?[\d\+\-]*')
35
+ register_prefix('FEAR', 'REACT', '[\d\+\-]+\-3D6?[\d\+\-]*')
36
36
 
37
37
  def initialize(command)
38
38
  super(command)
@@ -41,26 +41,23 @@ module BCDice
41
41
  end
42
42
 
43
43
  # ゲーム別成功度判定(nD6)
44
- def check_nD6(total, dice_total, dice_list, cmp_op, target)
45
- return '' if target == '?'
46
- return '' unless dice_list.size == 3 && cmp_op == :<=
44
+ def result_nd6(total, dice_total, dice_list, cmp_op, target)
45
+ return nil if target == "?"
46
+ return nil unless dice_list.size == 3 && cmp_op == :<=
47
47
 
48
48
  success = target - total # 成功度
49
49
 
50
- result =
51
- if critical?(dice_total, target)
52
- "クリティカル(成功度:#{success})"
53
- elsif fumble?(dice_total, target)
54
- "ファンブル(失敗度:#{success})"
55
- elsif dice_total >= 17
56
- "自動失敗(失敗度:#{success})"
57
- elsif total <= target
58
- "成功(成功度:#{success})"
59
- else
60
- "失敗(失敗度:#{success})"
61
- end
62
-
63
- " > #{result}"
50
+ if critical?(dice_total, target)
51
+ Result.critical("クリティカル(成功度:#{success})")
52
+ elsif fumble?(dice_total, target)
53
+ Result.fumble("ファンブル(失敗度:#{success})")
54
+ elsif dice_total >= 17
55
+ Result.failure("自動失敗(失敗度:#{success})")
56
+ elsif total <= target
57
+ Result.success("成功(成功度:#{success})")
58
+ else
59
+ Result.failure("失敗(失敗度:#{success})")
60
+ end
64
61
  end
65
62
 
66
63
  def eval_game_system_specific_command(command)
@@ -85,16 +82,8 @@ module BCDice
85
82
  modifier = ArithmeticEvaluator.eval(m[2])
86
83
  formated_modifier = Format.modifier(modifier)
87
84
 
88
- dice_list = @randomizer.roll_barabara(3, 6)
89
- dice_total = dice_list.sum()
90
- dice_str = dice_list.join(",")
91
-
92
- total = dice_total + modifier
93
-
94
- "(3D6#{formated_modifier}<=#{target_number}) > "\
95
- "#{dice_total}[#{dice_str}]#{formated_modifier} > "\
96
- "#{total}"\
97
- "#{check_nD6(total, dice_total, dice_list, :<=, target_number)}"
85
+ cmd = "3D6#{formated_modifier}<=#{target_number}"
86
+ return CommonCommand::AddDice.eval(cmd, self, @randomizer)
98
87
  end
99
88
 
100
89
  def roll_fear(command)
@@ -654,7 +654,7 @@ module BCDice
654
654
  )
655
655
  }.freeze
656
656
 
657
- register_prefix('GR', '[CEFAL]D[CT][-+\d]+', 'GHA[-+\d]+', TABLES.keys)
657
+ register_prefix('GR', '[CEFAL]D[CT]', 'GHA', TABLES.keys)
658
658
  end
659
659
  end
660
660
  end
@@ -26,7 +26,7 @@ module BCDice
26
26
  INFO_MESSAGE_TEXT
27
27
 
28
28
  register_prefix(
29
- 'GO(\-?\d+)(\/\d+)?(@\d+)?',
29
+ 'GO',
30
30
  'DC(SL|BL|IM|BR|RF|EL).+'
31
31
  )
32
32
 
@@ -26,7 +26,7 @@ module BCDice
26
26
   例)GL
27
27
  MESSAGETEXT
28
28
 
29
- register_prefix('GK(#\d+)?', 'GL')
29
+ register_prefix('GK', 'GL')
30
30
 
31
31
  def eval_game_system_specific_command(command)
32
32
  output = nil
@@ -41,7 +41,7 @@ module BCDice
41
41
  MESSAGETEXT
42
42
 
43
43
  # 因果点は共有リソースなのでMCPIはシークレットダイスを無効化
44
- register_prefix('GS\(\d+\)', 'GS', '^MCPI.*\$\d+$', 'DB\d+')
44
+ register_prefix('GS', '^MCPI.*$', 'DB')
45
45
 
46
46
  def initialize(command)
47
47
  super(command)
@@ -28,15 +28,9 @@ module BCDice
28
28
  return string
29
29
  end
30
30
 
31
- def check_2D6(total, _dice_total, dice_list, cmp_op, target)
32
- return '' if target == '?'
33
-
31
+ def result_2d6(_total, _dice_total, dice_list, _cmp_op, _target)
34
32
  if dice_list == [5, 5]
35
- "ゴリティカル(自動的成功)"
36
- elsif total.send(cmp_op, target)
37
- " > 成功"
38
- else
39
- " > 失敗"
33
+ Result.critical("ゴリティカル(自動的成功)")
40
34
  end
41
35
  end
42
36
  end
@@ -46,29 +46,36 @@ module BCDice
46
46
  end
47
47
 
48
48
  # ゲーム別成功度判定(nD6)
49
- def check_nD6(total, _dice_total, dice_list, cmp_op, target)
50
- result = ''
49
+ def result_nd6(total, _dice_total, dice_list, cmp_op, target)
50
+ return nil unless cmp_op == :>=
51
+
52
+ result = Result.new
53
+ sequence = []
51
54
 
52
55
  if dice_list.count(6) >= 2
53
56
  total += 10
54
- result = "(クリティカル) > #{total}"
57
+ result.critical = true
58
+ sequence.push("(クリティカル)", total.to_s)
55
59
  end
56
60
 
57
- if cmp_op != :>= || target == '?'
58
- return result
61
+ if target != '?'
62
+ if total >= target
63
+ sequence.push("成功")
64
+ result.success = true
65
+ else
66
+ sequence.push("失敗")
67
+ result.failure = true
68
+ end
59
69
  end
60
70
 
61
- if total >= target
62
- result += " > 成功"
63
- else
64
- result += " > 失敗"
71
+ if sequence.empty?
72
+ return nil
65
73
  end
66
74
 
75
+ result.text = sequence.join(" > ")
67
76
  return result
68
77
  end
69
78
 
70
- alias check_2D6 check_nD6
71
-
72
79
  def eval_game_system_specific_command(command)
73
80
  debug("eval_game_system_specific_command command", command)
74
81
 
@@ -24,14 +24,15 @@ module BCDice
24
24
  end
25
25
 
26
26
  # ゲーム別成功度判定(1d100)
27
- def check_1D100(total, _dice_total, cmp_op, target)
28
- return '' if target == '?'
29
- return '' unless cmp_op == :<=
27
+ def result_1d100(total, _dice_total, cmp_op, target)
28
+ return nil unless cmp_op == :<=
30
29
 
31
30
  if total >= 100
32
- "ファンブル"
31
+ Result.fumble("ファンブル")
33
32
  elsif total <= 1
34
- "絶対成功(達成値1+SL)"
33
+ Result.critical("絶対成功(達成値1+SL)")
34
+ elsif target == "?"
35
+ Result.nothing
35
36
  elsif total <= target
36
37
  dig10 = total / 10
37
38
  dig1 = total - dig10 * 10
@@ -39,12 +40,12 @@ module BCDice
39
40
  dig1 = 0 if dig1 >= 10 # 条件的にはあり得ない(笑
40
41
 
41
42
  if dig1 <= 0
42
- "クリティカル(達成値20+SL)"
43
+ Result.critical("クリティカル(達成値20+SL)")
43
44
  else
44
- "成功(達成値#{dig10 + dig1}+SL)"
45
+ Result.success("成功(達成値#{dig10 + dig1}+SL)")
45
46
  end
46
47
  else
47
- "失敗"
48
+ Result.failure("失敗")
48
49
  end
49
50
  end
50
51
  end
@@ -26,7 +26,7 @@ module BCDice
26
26
   修正を後ろに書くことも出来ます。
27
27
  INFO_MESSAGE_TEXT
28
28
 
29
- register_prefix('(.DPT|.FT)(\+|\-)?\d*')
29
+ register_prefix('.DPT', '.FT')
30
30
 
31
31
  def initialize(command)
32
32
  super(command)
@@ -35,14 +35,15 @@ module BCDice
35
35
 
36
36
  # ---- 以降、Gundog.rbよりほぼコピペ(絶対成功→ベアリーに用語変更対応の為、継承だと不都合)
37
37
  # ゲーム別成功度判定(1d100)
38
- def check_1D100(total, _dice_total, cmp_op, target)
39
- return '' if target == '?'
40
- return '' unless cmp_op == :<=
38
+ def result_1d100(total, _dice_total, cmp_op, target)
39
+ return nil unless cmp_op == :<=
41
40
 
42
41
  if total >= 100
43
- "ファンブル"
42
+ Result.fumble("ファンブル")
44
43
  elsif total <= 1
45
- "ベアリー(達成値1+SL)"
44
+ Result.critical("ベアリー(達成値1+SL)")
45
+ elsif target == "?"
46
+ Result.nothing
46
47
  elsif total <= target
47
48
  dig10 = total / 10
48
49
  dig1 = total - dig10 * 10
@@ -50,12 +51,12 @@ module BCDice
50
51
  dig1 = 0 if dig1 >= 10 # 条件的にはあり得ない(笑
51
52
 
52
53
  if dig1 <= 0
53
- "クリティカル(達成値20+SL)"
54
+ Result.critical("クリティカル(達成値20+SL)")
54
55
  else
55
- "成功(達成値#{dig10 + dig1}+SL)"
56
+ Result.success("成功(達成値#{dig10 + dig1}+SL)")
56
57
  end
57
58
  else
58
- "失敗"
59
+ Result.failure("失敗")
59
60
  end
60
61
  end
61
62