bcdice 3.11.0 → 3.13.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 (71) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +58 -0
  3. data/i18n/FutariSousa/ko_kr.yml +1625 -529
  4. data/i18n/Insane/ko_kr.yml +393 -258
  5. data/i18n/NinjaSlayer2/ja_jp.yml +34 -0
  6. data/lib/bcdice/arithmetic/parser.rb +4 -2
  7. data/lib/bcdice/base.rb +1 -1
  8. data/lib/bcdice/command/parser.rb +4 -2
  9. data/lib/bcdice/common_command/add_dice/parser.rb +4 -2
  10. data/lib/bcdice/common_command/barabara_dice/parser.rb +4 -2
  11. data/lib/bcdice/common_command/calc/parser.rb +4 -2
  12. data/lib/bcdice/common_command/reroll_dice/parser.rb +4 -2
  13. data/lib/bcdice/common_command/tally_dice/parser.rb +4 -2
  14. data/lib/bcdice/common_command/upper_dice/parser.rb +4 -2
  15. data/lib/bcdice/game_system/Airgetlamh.rb +1 -1
  16. data/lib/bcdice/game_system/Alsetto.rb +2 -2
  17. data/lib/bcdice/game_system/AniMalus.rb +221 -0
  18. data/lib/bcdice/game_system/ArknightsFan.rb +182 -0
  19. data/lib/bcdice/game_system/Avandner.rb +1 -1
  20. data/lib/bcdice/game_system/BBN.rb +1 -1
  21. data/lib/bcdice/game_system/BadLife.rb +3 -3
  22. data/lib/bcdice/game_system/BarnaKronika.rb +1 -1
  23. data/lib/bcdice/game_system/Chill3.rb +6 -6
  24. data/lib/bcdice/game_system/DarkSouls.rb +1 -1
  25. data/lib/bcdice/game_system/Elric.rb +1 -1
  26. data/lib/bcdice/game_system/Emoklore.rb +4 -6
  27. data/lib/bcdice/game_system/FullFace.rb +92 -0
  28. data/lib/bcdice/game_system/FutariSousa_Korean.rb +44 -19
  29. data/lib/bcdice/game_system/HunterTheReckoning5th.rb +10 -3
  30. data/lib/bcdice/game_system/InfiniteFantasia.rb +4 -1
  31. data/lib/bcdice/game_system/Insane_Korean.rb +11 -11
  32. data/lib/bcdice/game_system/Irisbane.rb +1 -1
  33. data/lib/bcdice/game_system/KamitsubakiCityUnderConstructionNarrative.rb +251 -0
  34. data/lib/bcdice/game_system/KillDeathBusiness.rb +1 -1
  35. data/lib/bcdice/game_system/KyokoShinshoku.rb +158 -0
  36. data/lib/bcdice/game_system/Liminal.rb +136 -0
  37. data/lib/bcdice/game_system/MetalHead.rb +1 -1
  38. data/lib/bcdice/game_system/MetalHeadExtream.rb +1 -1
  39. data/lib/bcdice/game_system/NRR.rb +122 -0
  40. data/lib/bcdice/game_system/NSSQ.rb +1 -1
  41. data/lib/bcdice/game_system/NightWizard.rb +1 -1
  42. data/lib/bcdice/game_system/NightWizard3rd.rb +15 -2
  43. data/lib/bcdice/game_system/NinjaSlayer.rb +3 -1
  44. data/lib/bcdice/game_system/NinjaSlayer2.rb +299 -0
  45. data/lib/bcdice/game_system/OneWayHeroics.rb +1 -1
  46. data/lib/bcdice/game_system/PastFutureParadox.rb +1238 -0
  47. data/lib/bcdice/game_system/Postman.rb +3 -3
  48. data/lib/bcdice/game_system/RecordOfSteam.rb +1 -1
  49. data/lib/bcdice/game_system/RuneQuestRoleplayingInGlorantha.rb +10 -7
  50. data/lib/bcdice/game_system/Ryutama.rb +4 -4
  51. data/lib/bcdice/game_system/SajinsenkiAGuS.rb +5 -1
  52. data/lib/bcdice/game_system/SajinsenkiAGuS2E.rb +285 -0
  53. data/lib/bcdice/game_system/Siren.rb +97 -0
  54. data/lib/bcdice/game_system/Skynauts.rb +1 -1
  55. data/lib/bcdice/game_system/SkynautsBouken.rb +1 -1
  56. data/lib/bcdice/game_system/Strave.rb +1 -1
  57. data/lib/bcdice/game_system/SwordWorld.rb +16 -0
  58. data/lib/bcdice/game_system/SwordWorld2_5.rb +8 -1
  59. data/lib/bcdice/game_system/TherapieSein.rb +1 -1
  60. data/lib/bcdice/game_system/TrinitySeven.rb +1 -1
  61. data/lib/bcdice/game_system/VampireTheMasquerade5th.rb +21 -9
  62. data/lib/bcdice/game_system/WerewolfTheApocalypse5th.rb +179 -0
  63. data/lib/bcdice/game_system/cthulhu7th/full_auto.rb +1 -1
  64. data/lib/bcdice/game_system/sword_world/rating_options.rb +3 -0
  65. data/lib/bcdice/game_system/sword_world/rating_parsed.rb +9 -0
  66. data/lib/bcdice/game_system/sword_world/rating_parser.rb +177 -130
  67. data/lib/bcdice/game_system/sword_world/transcendent_test.rb +1 -1
  68. data/lib/bcdice/game_system.rb +12 -0
  69. data/lib/bcdice/loader.rb +1 -1
  70. data/lib/bcdice/version.rb +1 -1
  71. metadata +32 -5
@@ -0,0 +1,34 @@
1
+ ja_jp:
2
+ NinjaSlayer2:
3
+ table:
4
+ SATSUBATSU:
5
+ name: "サツバツ!!(D6) > "
6
+ type: 1D6
7
+ items:
8
+ - "「イヤーッ!」腹部に強烈な一撃が命中! 敵はくの字に折れ曲がり、ワイヤーアクションめいて吹っ飛んだ! \n『痛打+1』。敵の【体力】を減らした場合、付属効果として『弾き飛ばし』を与える。"
9
+ - "「観念してハイクを詠め!」頭部への痛烈なカラテが命中! 眼球破壊もしくは激しい脳震盪が敵を襲う! \n『痛打+1』。敵の【体力】を減らした場合、付属効果として『ニューロンダメージ2』と『ワザマエダメージ1』と『●部位損傷:頭部』を与える。"
10
+ - "「苦しみ抜いて死ぬがいい!」急所や内臓を情け容赦なく破壊! \n『痛打+1』。敵の【体力】を減らした場合、付属効果として『ニューロンダメージ1』と『精神力ダメージ2』と『●部位損傷:胴体』を与える。"
11
+ - "「どこへ逃げても無駄だ!」敵の脚を無慈悲に粉砕! \n『痛打+1』。敵の【体力】を減らした場合、付属効果として『カラテダメージ1』と『脚力ダメージ2』と『●部位損傷:脚部』を与える。"
12
+ - "「これで手も足も出まい!」敵の両腕をダブルチョップ切断! 傷口から鮮血がスプリンクラーめいて噴き出す! \n『痛打+1』。敵の【体力】を減らした場合、付属効果として『カラテダメージ2』と『ワザマエダメージ2』と『●部位損傷:腕部』を与える。"
13
+ - "「さらばだ! イイイヤアアアアーーーーッ!」ヤリめいたチョップが敵の胸を貫通! さらに心臓を掴み取り、握りつぶした! ゴウランガ! \n『即死!』。敵が『即死耐性』を持つ場合、この効果は『痛打+2D6』に置き換えられる。"
14
+ WASSHOI:
15
+ name: "ニンジャスレイヤー=サンのエントリー!!(D6) > "
16
+ type: 1D6
17
+ items:
18
+ - "高所からの回転着地! タタミ四枚の距離で睨み合った! \n標的ニンジャから3または4マス離れた任意のマスに、【殺】コマを置くこと。"
19
+ - "ドアを蹴破って出現! \n標的ニンジャがいる部屋の任意のドアの隣に【殺】コマを置くこと。 \nなお、ドアにあらかじめ鍵をかけるなどの行為は全て無駄である。"
20
+ - "KRAAAAASH! 窓を突き破り出現! \n標的ニンジャがいる部屋の任意の窓の隣に【殺】コマを置くこと。 \n【殺】コマが隣接している間、その窓は脱出用として使用できなくなる。"
21
+ - "天井破壊や床破砕、または垂直リフト射出により出現! \n標的ニンジャから2マス離れた任意の場所に【殺】コマを置くこと。 \n激しい恐怖や動揺により、次のターンの終了時まで、その場にいる【DKK】1以上のニンジャ全員は『連続側転判定』の難易度が+1される。"
22
+ - "冷蔵庫や金庫から突如出現! \nそのマップ上に存在するトレジャーボックス内に、ニンジャスレイヤーが潜んでいた。標的ニンジャから最も近いトレジャーボックス1個(もしくは適切な障害物や爆発物)の隣に【殺】コマを置くこと。 \n激しい恐怖や動揺により、次のターンの終了時まで、その場にいる【DKK】1以上のニンジャ全員は『連続側転判定』の難易度が+1される。"
23
+ - "「行き先はジゴクですよ」 \nマップ上にいるNPC1人(標的ニンジャから最も近くにいる者)が、実はニンジャスレイヤーの変装であった。そのNPCのコマを【殺】に変更せよ(本物のNPCがどこにいったのかはニンジャマスターが後で考える)。 \n激しい恐怖や動揺により、次のターンの終了時まで、その場にいる【DKK】1以上のニンジャ全員は『連続側転判定』の難易度が+2される。"
24
+ NRS:
25
+ name: "ニンジャ・リアリティ・ショック発症(D7) > "
26
+ type: 1D7
27
+ items:
28
+ - "絶叫 \n恐怖のあまり、その場で絶叫を上げる。 \n探索中の場合、近くの敵に存在を気づかれる可能性がある(シナリオ次第)。 \n戦闘中の場合、恐怖のあまり足がガクガクと震え、このターン終了まで【脚力】が0となり、『崩れ状態』とみなされる。"
29
+ - "失禁 \n恐怖とトラウマのあまりその場で立ちすくみ、失禁する。自尊心を失い【精神力】が-1される。 \n戦闘中の場合、足がすくんで手がブルブルと震え、このターン終了まであらゆる自発的行動の難易度が+1され、【脚力】が1となり、『崩れ状態』とみなされる。"
30
+ - "パニック逃走や異常行動 \n恐怖のあまり絶叫し、仲間を見捨ててその場から全速力で逃げ出そうとしたり、銃を持っている場合は見えない敵に向かって乱射しようとする。 \nあるいは仲間のことをニンジャだと思い込んで攻撃を仕掛けたり、理解不能な異常行動を取ったりする。 \n探索シーケンスの場合、直ちに戦闘シーケンスが発生してこのPCの手番となり、1ターンだけマスターがこのPCを操作する。このPCは常軌を逸した身体能力を発揮し、【脚力】6として行動する。マスターはこのPCに自傷行為以外のどんな行動を取らせてもよい。このPCにとっては、あらゆるキャラが敵とみなされる。このターンの終了時に、このPCは正気に戻る。 \n戦闘中の場合も同様で、次の手番にこの状態となる。手番開始時に攻撃できる相手がニンジャしか見えていない場合、逃走を優先する。"
31
+ - "ドゲザ \n失禁し【精神力】に1ダメージ。突然ドゲザによる命乞いを行うため、このターン終了時まで『麻痺状態』とみなされる。"
32
+ - "激しい嘔吐や鼻血 \n【体力】と【精神力】にそれぞれ1ダメージを受ける。 \n戦闘中の場合、このターンのあらゆる判定難易度が+1される。 \nしかし目の前の脅威に立ち向かおうとする意志は砕けていない。"
33
+ - "気絶 \n失禁し【精神力】に1ダメージ。さらに打ち上げられたマグロめいてその場で倒れて口をパクパクとさせ、『気絶状態』となる。 \n戦闘が終了するか、一定時間が経過するか、誰かに蘇生してもらうまで、この状態は解除されない。"
34
+ - "心臓発作や狂死 \n急激なニンジャリアリティショックに耐えきれず、PCは心臓発作やニューロン損傷を起こして【体力】0となり、その場に倒れ『気絶状態』となる。 \nZBRアドレナリンでなければ蘇生できない。処置を受けずに時間が経過すると死亡する。"
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.6.2
4
- # from Racc grammar file "".
3
+ # This file is automatically generated by Racc 1.7.3
4
+ # from Racc grammar file "parser.y".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -130,6 +130,7 @@ Racc_arg = [
130
130
  racc_shift_n,
131
131
  racc_reduce_n,
132
132
  racc_use_result_var ]
133
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
133
134
 
134
135
  Racc_token_to_s_table = [
135
136
  "$end",
@@ -151,6 +152,7 @@ Racc_token_to_s_table = [
151
152
  "unary",
152
153
  "round_type",
153
154
  "term" ]
155
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
154
156
 
155
157
  Racc_debug_parser = false
156
158
 
data/lib/bcdice/base.rb CHANGED
@@ -58,7 +58,7 @@ module BCDice
58
58
  @prefixes.freeze
59
59
  pattarns = CommonCommand::COMMANDS.map { |c| c::PREFIX_PATTERN.source } + @prefixes
60
60
 
61
- @command_pattern = /^S?(#{pattarns.join("|")})/i.freeze
61
+ @command_pattern = /^S?(#{pattarns.join('|')})/i.freeze
62
62
  end
63
63
 
64
64
  # @param command [String]
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.6.2
4
- # from Racc grammar file "".
3
+ # This file is automatically generated by Racc 1.7.3
4
+ # from Racc grammar file "parser.y".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -312,6 +312,7 @@ Racc_arg = [
312
312
  racc_shift_n,
313
313
  racc_reduce_n,
314
314
  racc_use_result_var ]
315
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
315
316
 
316
317
  Racc_token_to_s_table = [
317
318
  "$end",
@@ -344,6 +345,7 @@ Racc_token_to_s_table = [
344
345
  "mul",
345
346
  "add",
346
347
  "round_type" ]
348
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
347
349
 
348
350
  Racc_debug_parser = false
349
351
 
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.6.2
4
- # from Racc grammar file "".
3
+ # This file is automatically generated by Racc 1.7.3
4
+ # from Racc grammar file "parser.y".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -200,6 +200,7 @@ Racc_arg = [
200
200
  racc_shift_n,
201
201
  racc_reduce_n,
202
202
  racc_use_result_var ]
203
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
203
204
 
204
205
  Racc_token_to_s_table = [
205
206
  "$end",
@@ -242,6 +243,7 @@ Racc_token_to_s_table = [
242
243
  "filter_type",
243
244
  "filter_type_with_shorthand",
244
245
  "filter_shorthand" ]
246
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
245
247
 
246
248
  Racc_debug_parser = false
247
249
 
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.6.2
4
- # from Racc grammar file "".
3
+ # This file is automatically generated by Racc 1.7.3
4
+ # from Racc grammar file "parser.y".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -154,6 +154,7 @@ Racc_arg = [
154
154
  racc_shift_n,
155
155
  racc_reduce_n,
156
156
  racc_use_result_var ]
157
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
157
158
 
158
159
  Racc_token_to_s_table = [
159
160
  "$end",
@@ -190,6 +191,7 @@ Racc_token_to_s_table = [
190
191
  "mul",
191
192
  "unary",
192
193
  "round_type" ]
194
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
193
195
 
194
196
  Racc_debug_parser = false
195
197
 
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.6.2
4
- # from Racc grammar file "".
3
+ # This file is automatically generated by Racc 1.7.3
4
+ # from Racc grammar file "parser.y".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -138,6 +138,7 @@ Racc_arg = [
138
138
  racc_shift_n,
139
139
  racc_reduce_n,
140
140
  racc_use_result_var ]
141
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
141
142
 
142
143
  Racc_token_to_s_table = [
143
144
  "$end",
@@ -162,6 +163,7 @@ Racc_token_to_s_table = [
162
163
  "unary",
163
164
  "round_type",
164
165
  "term" ]
166
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
165
167
 
166
168
  Racc_debug_parser = false
167
169
 
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.6.2
4
- # from Racc grammar file "".
3
+ # This file is automatically generated by Racc 1.7.3
4
+ # from Racc grammar file "parser.y".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -175,6 +175,7 @@ Racc_arg = [
175
175
  racc_shift_n,
176
176
  racc_reduce_n,
177
177
  racc_use_result_var ]
178
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
178
179
 
179
180
  Racc_token_to_s_table = [
180
181
  "$end",
@@ -212,6 +213,7 @@ Racc_token_to_s_table = [
212
213
  "mul",
213
214
  "unary",
214
215
  "round_type" ]
216
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
215
217
 
216
218
  Racc_debug_parser = false
217
219
 
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.6.2
4
- # from Racc grammar file "".
3
+ # This file is automatically generated by Racc 1.7.3
4
+ # from Racc grammar file "parser.y".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -144,6 +144,7 @@ Racc_arg = [
144
144
  racc_shift_n,
145
145
  racc_reduce_n,
146
146
  racc_use_result_var ]
147
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
147
148
 
148
149
  Racc_token_to_s_table = [
149
150
  "$end",
@@ -173,6 +174,7 @@ Racc_token_to_s_table = [
173
174
  "mul",
174
175
  "unary",
175
176
  "round_type" ]
177
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
176
178
 
177
179
  Racc_debug_parser = false
178
180
 
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.6.2
4
- # from Racc grammar file "".
3
+ # This file is automatically generated by Racc 1.7.3
4
+ # from Racc grammar file "parser.y".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -181,6 +181,7 @@ Racc_arg = [
181
181
  racc_shift_n,
182
182
  racc_reduce_n,
183
183
  racc_use_result_var ]
184
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
184
185
 
185
186
  Racc_token_to_s_table = [
186
187
  "$end",
@@ -220,6 +221,7 @@ Racc_token_to_s_table = [
220
221
  "term",
221
222
  "unary",
222
223
  "round_type" ]
224
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
223
225
 
224
226
  Racc_debug_parser = false
225
227
 
@@ -102,7 +102,7 @@ module BCDice
102
102
  totalDamage = totalSuccessCount * damage + totalCriticalCount * criticalTrigger
103
103
 
104
104
  result += "(#{diceCount}D10\<\=#{target}) > #{text} > Hits:#{totalSuccessCount}*#{damage}"
105
- result += " + Trigger:#{totalCriticalCount}*#{criticalTrigger}" if criticalTrigger > 0
105
+ result += " + Trigger:#{totalCriticalCount}*#{criticalTrigger}" if criticalTrigger > 0
106
106
  result += " > #{totalDamage}ダメージ"
107
107
  else
108
108
  result += "(#{diceCount}D10\<\=#{target}) > #{text} > 成功数:#{totalSuccessCount}"
@@ -50,7 +50,7 @@ module BCDice
50
50
  if command =~ /(\d+)AL(C|G)?(\d+)?((x|\*)(\d+))?$/i
51
51
  rapid = Regexp.last_match(1).to_i
52
52
  isCritical = Regexp.last_match(2).nil?
53
- if isCritical
53
+ if isCritical
54
54
  criticalNumber = 1
55
55
  else
56
56
  if Regexp.last_match(2) == "G"
@@ -98,7 +98,7 @@ module BCDice
98
98
  text += "+" unless text.empty?
99
99
  text += "#{successCount}[#{diceText}]"
100
100
 
101
- break unless isCritical
101
+ break unless isCritical
102
102
 
103
103
  rollCount = criticalCount
104
104
  end
@@ -0,0 +1,221 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BCDice
4
+ module GameSystem
5
+ class AniMalus < Base
6
+ # ゲームシステムの識別子
7
+ ID = 'AniMalus'
8
+
9
+ # ゲームシステム名
10
+ NAME = 'アニマラス'
11
+
12
+ # ゲームシステム名の読みがな
13
+ SORT_KEY = 'あにまらす'
14
+
15
+ # ダイスボットの使い方
16
+ HELP_MESSAGE = <<~INFO_MESSAGETEXT
17
+ ■ステータスのダイス判定 nAM<=t,x n:能力値 t:成功値 x:必要成功数
18
+ 例)3AM<=2,1: ダイスを3個振って、成功値2,必要成功数1で判定。その結果(成功数,成功・失敗)を表示
19
+
20
+ ■探索技能のダイス判定 AI<=t,x t:探索技能レベル x:必要成功数
21
+ 例)AI<=3,1: ダイスを3個振って、探索技能レベル3,必要成功数1で判定。その結果(成功数,成功・失敗)を表示
22
+
23
+ ■攻撃判定 AA<=t t:戦闘技能レベル
24
+ 例)AA<=3: ダイスを3個振って、戦闘技能レベル3で判定。その結果(成功・失敗,ダメージ,クリティカル,ファンブル)を表示
25
+
26
+ ■防御判定 AG=t t:攻撃技能レベル
27
+ 例)AG=2: ダイスを3個振って、攻撃技能レベル2で判定。その結果(成功・失敗,ダメージ,クリティカル,ファンブル)を表示
28
+
29
+ ■回避判定 AD=t t:攻撃技能レベル
30
+ 例)AD=3: ダイスを1個振って、攻撃技能レベル3で判定。その結果(成功・失敗)を表示
31
+ INFO_MESSAGETEXT
32
+
33
+ register_prefix('\d*A[MIAGD]')
34
+
35
+ def initialize(command)
36
+ super(command)
37
+
38
+ @sort_barabara_dice = true # バラバラロール(Bコマンド)でソート有
39
+ end
40
+
41
+ def eval_game_system_specific_command(command)
42
+ resolute_action(command) ||
43
+ resolute_investigation(command) ||
44
+ resolute_attacking(command) ||
45
+ resolute_guarding(command) ||
46
+ resolute_dodging(command)
47
+ end
48
+
49
+ private
50
+
51
+ # ステータスの判定
52
+ # @param [String] command
53
+ # @return [Result]
54
+ def resolute_action(command)
55
+ m = /^(\d+)AM<=(\d+),(\d)$/.match(command)
56
+ return nil unless m
57
+
58
+ num_dice = m[1].to_i
59
+ num_target = m[2].to_i
60
+ num_success = m[3].to_i
61
+
62
+ dice = @randomizer.roll_barabara(num_dice, 6).sort
63
+ dice_text = dice.join(",")
64
+ success_num = dice.count { |val| val <= num_target }
65
+ output = "(#{num_dice}AM<=#{num_target},#{num_success}) > #{dice_text} > 成功数#{success_num}"
66
+ if success_num >= num_success
67
+ output += " > 成功"
68
+ return Result.success(output)
69
+ else
70
+ output += " > 失敗"
71
+ return Result.failure(output)
72
+ end
73
+ end
74
+
75
+ # 探索技能の判定
76
+ # @param [String] command
77
+ # @return [Result]
78
+ def resolute_investigation(command)
79
+ m = /^AI<=(\d+),(\d)$/.match(command)
80
+ return nil unless m
81
+
82
+ num_target = m[1].to_i
83
+ num_success = m[2].to_i
84
+
85
+ dice = @randomizer.roll_barabara(3, 6).sort
86
+ dice_text = dice.join(",")
87
+ success_num = dice.count { |val| val <= num_target }
88
+ output = "(AI<=#{num_target},#{num_success}) > #{dice_text} > 成功数#{success_num}"
89
+ if success_num >= num_success
90
+ output += " > 成功"
91
+ return Result.success(output)
92
+ else
93
+ output += " > 失敗"
94
+ return Result.failure(output)
95
+ end
96
+ end
97
+
98
+ # 攻撃技能の判定
99
+ # @param [String] command
100
+ # @return [Result]
101
+ def resolute_attacking(command)
102
+ m = /^AA<=(\d+)$/.match(command)
103
+ return nil unless m
104
+
105
+ num_target = m[1].to_i
106
+
107
+ dice = @randomizer.roll_barabara(3, 6).sort
108
+ dice_text = dice.join(",")
109
+ success_num = dice.count { |val| val <= num_target }
110
+ is_critical = dice[0] == 1 && dice[1] == 2 && dice[2] == 3
111
+ is_fumble = dice[0] == 4 && dice[1] == 5 && dice[2] == 6
112
+ damage1 = dice.max
113
+ damage2 = dice.max
114
+ if dice[0] == dice[1] && dice[1] == dice[2] && dice[2] <= num_target
115
+ damage2 += 6
116
+ damage1 = damage2
117
+ elsif dice[0] == dice[1] && dice[1] <= num_target
118
+ damage2 += 3
119
+ elsif dice[1] == dice[2] && dice[2] <= num_target
120
+ damage2 += 3
121
+ end
122
+
123
+ return Result.new.tap do |result|
124
+ result.critical = is_critical
125
+ result.fumble = is_fumble
126
+ result.condition = (success_num > 0)
127
+
128
+ sequence = [
129
+ "(AA<=#{num_target})",
130
+ dice_text,
131
+ "成功数#{success_num}",
132
+ if result.success?
133
+ "成功"
134
+ else
135
+ "失敗"
136
+ end
137
+ ].compact
138
+ if result.success?
139
+ if damage1 == damage2
140
+ sequence.push("ダメージ(#{damage1})")
141
+ else
142
+ sequence.push("ダメージ(#{damage1}か#{damage2})")
143
+ end
144
+ end
145
+ sequence.push("クリティカル") if result.critical?
146
+ sequence.push("ファンブル") if result.fumble?
147
+
148
+ result.text = sequence.join(" > ")
149
+ end
150
+ end
151
+
152
+ # 防御技能の判定
153
+ # @param [String] command
154
+ # @return [Result]
155
+ def resolute_guarding(command)
156
+ m = /^AG=(\d+)$/.match(command)
157
+ return nil unless m
158
+
159
+ num_target = m[1].to_i
160
+
161
+ dice = @randomizer.roll_barabara(3, 6).sort
162
+ dice_text = dice.join(",")
163
+ success_num = dice.count(num_target)
164
+ is_critical = dice[0] == 1 && dice[1] == 2 && dice[2] == 3
165
+ is_fumble = dice[0] == 4 && dice[1] == 5 && dice[2] == 6
166
+
167
+ return Result.new.tap do |result|
168
+ result.critical = is_critical
169
+ result.fumble = is_fumble
170
+ result.condition = (success_num > 0)
171
+
172
+ sequence = [
173
+ "(AG=#{num_target})",
174
+ dice_text,
175
+ "成功数#{success_num}",
176
+ if result.success?
177
+ "成功 > ダメージ軽減(#{success_num * 2})"
178
+ else
179
+ "失敗"
180
+ end
181
+ ].compact
182
+ sequence.push("クリティカル") if result.critical?
183
+ sequence.push("ファンブル") if result.fumble?
184
+
185
+ result.text = sequence.join(" > ")
186
+ end
187
+ end
188
+
189
+ # 回避技能の判定
190
+ # @param [String] command
191
+ # @return [Result]
192
+ def resolute_dodging(command)
193
+ m = /^AD=(\d+)$/.match(command)
194
+ return nil unless m
195
+
196
+ num_target = m[1].to_i
197
+
198
+ dice = @randomizer.roll_barabara(1, 6)
199
+ dice_text = dice.join(",")
200
+ success_num = dice.count(num_target)
201
+
202
+ return Result.new.tap do |result|
203
+ result.condition = (success_num > 0)
204
+
205
+ sequence = [
206
+ "(AD=#{num_target})",
207
+ dice_text,
208
+ "成功数#{success_num}",
209
+ if result.success?
210
+ "成功(ダメージ無効)"
211
+ else
212
+ "失敗"
213
+ end
214
+ ].compact
215
+
216
+ result.text = sequence.join(" > ")
217
+ end
218
+ end
219
+ end
220
+ end
221
+ end