bcdice 3.15.0 → 3.17.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 (158) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +140 -0
  3. data/i18n/Airgetlamh/ja_jp.yml +5 -0
  4. data/i18n/Airgetlamh/ko_kr.yml +5 -0
  5. data/i18n/Alsetto/ja_jp.yml +5 -0
  6. data/i18n/Alsetto/ko_kr.yml +5 -0
  7. data/i18n/AnimaAnimus/ja_jp.yml +28 -0
  8. data/i18n/AnimaAnimus/ko_kr.yml +28 -0
  9. data/i18n/BlackJacket/ja_jp.yml +79 -0
  10. data/i18n/BlackJacket/ko_kr.yml +79 -0
  11. data/i18n/Bloodorium/ja_jp.yml +3 -0
  12. data/i18n/Bloodorium/ko_kr.yml +3 -0
  13. data/i18n/Cthulhu/ko_kr.yml +1 -1
  14. data/i18n/DoubleCross/ja_jp.yml +2 -2
  15. data/i18n/Dracurouge/ko_kr.yml +1284 -205
  16. data/i18n/Emoklore/ja_jp.yml +1 -0
  17. data/i18n/Emoklore/ko_kr.yml +8 -0
  18. data/i18n/FutariSousa/ja_jp.yml +70 -0
  19. data/i18n/FutariSousa/ko_kr.yml +157 -0
  20. data/i18n/HatsuneMiku/ja_jp.yml +579 -0
  21. data/i18n/HatsuneMiku/ko_kr.yml +579 -0
  22. data/i18n/Irisbane/ja_jp.yml +27 -0
  23. data/i18n/Irisbane/ko_kr.yml +27 -0
  24. data/i18n/JuinKansen/ja_jp.yml +168 -0
  25. data/i18n/JuinKansen/ko_kr.yml +168 -0
  26. data/i18n/KemonoNoMori/ja_jp.yml +229 -0
  27. data/i18n/KemonoNoMori/ko_kr.yml +229 -0
  28. data/i18n/KizunaBullet/ko_kr.yml +653 -0
  29. data/i18n/MagicPunk/ja_jp.yml +5 -0
  30. data/i18n/MagicPunk/ko_kr.yml +5 -0
  31. data/i18n/MorkBorg/ja_jp.yml +34 -0
  32. data/i18n/MorkBorg/ko_kr.yml +34 -0
  33. data/i18n/Nechronica/ko_kr.yml +43 -0
  34. data/i18n/NegikureNegimaki/ja_jp.yml +6 -0
  35. data/i18n/NegikureNegimaki/ko_kr.yml +6 -0
  36. data/i18n/Nuekagami/ja_jp.yml +219 -0
  37. data/i18n/Nuekagami/ko_kr.yml +219 -0
  38. data/i18n/Revulture/ja_jp.yml +8 -0
  39. data/i18n/Revulture/ko_kr.yml +8 -0
  40. data/i18n/SRS/ja_jp.yml +4 -0
  41. data/i18n/SRS/ko_kr.yml +4 -0
  42. data/i18n/ShinobiGami/ja_jp.yml +879 -0
  43. data/i18n/ShinobiGami/ko_kr.yml +876 -0
  44. data/i18n/SkynautsBouken/ja_jp.yml +28 -28
  45. data/i18n/StarryDolls/ja_jp.yml +456 -0
  46. data/i18n/StarryDolls/ko_kr.yml +456 -0
  47. data/i18n/StratoShout/ja_jp.yml +8 -8
  48. data/i18n/SwordWorld2_5/ja_jp.yml +48 -0
  49. data/i18n/Ventangle/ja_jp.yml +4 -0
  50. data/i18n/Ventangle/ko_kr.yml +4 -0
  51. data/i18n/YearZeroEngine/ja_jp.yml +12 -0
  52. data/i18n/YearZeroEngine/ko_kr.yml +12 -0
  53. data/i18n/ZombiLine/ja_jp.yml +27 -0
  54. data/i18n/ZombiLine/ko_kr.yml +27 -0
  55. data/i18n/ko_kr.yml +2 -0
  56. data/i18n/zh_hant.yml +2 -2
  57. data/lib/bcdice/dice_table/d66_left_range_table.rb +21 -0
  58. data/lib/bcdice/game_system/Aionia.rb +68 -19
  59. data/lib/bcdice/game_system/Airgetlamh.rb +64 -41
  60. data/lib/bcdice/game_system/Airgetlamh_Korean.rb +53 -0
  61. data/lib/bcdice/game_system/Alsetto.rb +63 -50
  62. data/lib/bcdice/game_system/Alsetto_Korean.rb +51 -0
  63. data/lib/bcdice/game_system/AnimaAnimus.rb +15 -32
  64. data/lib/bcdice/game_system/AnimaAnimus_Korean.rb +39 -0
  65. data/lib/bcdice/game_system/BlackJacket.rb +57 -113
  66. data/lib/bcdice/game_system/BlackJacket_Korean.rb +8 -206
  67. data/lib/bcdice/game_system/Bloodorium.rb +1 -1
  68. data/lib/bcdice/game_system/Bloodorium_Korean.rb +34 -0
  69. data/lib/bcdice/game_system/ChroniclesOfDarkness2e.rb +163 -0
  70. data/lib/bcdice/game_system/Cthulhu7th_Korean.rb +471 -300
  71. data/lib/bcdice/game_system/DeadlineHeroes_Korean.rb +273 -0
  72. data/lib/bcdice/game_system/Dracurouge_Korean.rb +25 -19
  73. data/lib/bcdice/game_system/DungeonsAndDragons5.rb +106 -73
  74. data/lib/bcdice/game_system/DungeonsAndDragons5_Korean.rb +53 -0
  75. data/lib/bcdice/game_system/DungeonsAndDragons_Korean.rb +61 -0
  76. data/lib/bcdice/game_system/EdgeFlippers.rb +315 -0
  77. data/lib/bcdice/game_system/Emoklore.rb +34 -9
  78. data/lib/bcdice/game_system/Emoklore_Korean.rb +50 -0
  79. data/lib/bcdice/game_system/FateCoreSystem.rb +10 -6
  80. data/lib/bcdice/game_system/FullMetalPanic_Korean.rb +28 -0
  81. data/lib/bcdice/game_system/FutariSousa.rb +37 -12
  82. data/lib/bcdice/game_system/FutariSousa_Korean.rb +25 -8
  83. data/lib/bcdice/game_system/GaiaCare.rb +40 -0
  84. data/lib/bcdice/game_system/Garactier.rb +1 -1
  85. data/lib/bcdice/game_system/GardenOrder.rb +2 -2
  86. data/lib/bcdice/game_system/GardenOrderReEdit.rb +849 -0
  87. data/lib/bcdice/game_system/GardenOrder_Korean.rb +839 -0
  88. data/lib/bcdice/game_system/HatsuneMiku.rb +51 -605
  89. data/lib/bcdice/game_system/HatsuneMiku_Korean.rb +56 -0
  90. data/lib/bcdice/game_system/HunterTheReckoning5th.rb +15 -11
  91. data/lib/bcdice/game_system/Irisbane.rb +17 -30
  92. data/lib/bcdice/game_system/Irisbane_Korean.rb +52 -0
  93. data/lib/bcdice/game_system/JuinKansen.rb +41 -208
  94. data/lib/bcdice/game_system/JuinKansen_Korean.rb +46 -0
  95. data/lib/bcdice/game_system/KemonoNoMori.rb +67 -276
  96. data/lib/bcdice/game_system/KemonoNoMori_Korean.rb +62 -0
  97. data/lib/bcdice/game_system/KinAriel.rb +117 -0
  98. data/lib/bcdice/game_system/KizunaBullet_Korean.rb +109 -0
  99. data/lib/bcdice/game_system/KutuluRevised.rb +94 -0
  100. data/lib/bcdice/game_system/LiverLabyrinth.rb +321 -0
  101. data/lib/bcdice/game_system/Lost.rb +89 -0
  102. data/lib/bcdice/game_system/MagicPunk.rb +85 -0
  103. data/lib/bcdice/game_system/MagicPunk_Korean.rb +39 -0
  104. data/lib/bcdice/game_system/MarvelHeroicRoleplaying.rb +144 -0
  105. data/lib/bcdice/game_system/MeikyuKingdomBasic.rb +122 -2
  106. data/lib/bcdice/game_system/MetallicGuardian_Korean.rb +28 -0
  107. data/lib/bcdice/game_system/MorkBorg.rb +170 -0
  108. data/lib/bcdice/game_system/MorkBorg_Korean.rb +49 -0
  109. data/lib/bcdice/game_system/NanimonaiMura.rb +112 -0
  110. data/lib/bcdice/game_system/Nechronica_Korean.rb +6 -6
  111. data/lib/bcdice/game_system/NegikureNegimaki.rb +140 -0
  112. data/lib/bcdice/game_system/NegikureNegimaki_Korean.rb +48 -0
  113. data/lib/bcdice/game_system/NeonUnderRealm.rb +122 -0
  114. data/lib/bcdice/game_system/NinjaSlayer2.rb +170 -49
  115. data/lib/bcdice/game_system/Nuekagami.rb +19 -261
  116. data/lib/bcdice/game_system/Nuekagami_Korean.rb +43 -0
  117. data/lib/bcdice/game_system/ParanoiaPerfect.rb +74 -0
  118. data/lib/bcdice/game_system/PastFutureParadox.rb +2245 -55
  119. data/lib/bcdice/game_system/PreciousDays.rb +170 -0
  120. data/lib/bcdice/game_system/Revulture.rb +8 -5
  121. data/lib/bcdice/game_system/Revulture_Korean.rb +51 -0
  122. data/lib/bcdice/game_system/Ryutama.rb +46 -46
  123. data/lib/bcdice/game_system/SRS.rb +4 -4
  124. data/lib/bcdice/game_system/SRS_Korean.rb +67 -0
  125. data/lib/bcdice/game_system/ShinobiGami.rb +154 -1047
  126. data/lib/bcdice/game_system/ShinobiGami_Korean.rb +102 -0
  127. data/lib/bcdice/game_system/StarryDolls.rb +70 -508
  128. data/lib/bcdice/game_system/StarryDolls_Korean.rb +80 -0
  129. data/lib/bcdice/game_system/StratoShout.rb +1 -1
  130. data/lib/bcdice/game_system/SwordWorld.rb +28 -2
  131. data/lib/bcdice/game_system/SwordWorld2_0.rb +1 -1
  132. data/lib/bcdice/game_system/SwordWorld2_5.rb +67 -3
  133. data/lib/bcdice/game_system/TacticalExorcist.rb +222 -0
  134. data/lib/bcdice/game_system/TenkaRyouran_Korean.rb +30 -0
  135. data/lib/bcdice/game_system/VampireTheMasquerade5th.rb +38 -33
  136. data/lib/bcdice/game_system/Ventangle.rb +8 -7
  137. data/lib/bcdice/game_system/Ventangle_Korean.rb +41 -0
  138. data/lib/bcdice/game_system/Warhammer4.rb +202 -6
  139. data/lib/bcdice/game_system/WerewolfTheApocalypse5th.rb +20 -15
  140. data/lib/bcdice/game_system/WorldEndScrapyard.rb +333 -0
  141. data/lib/bcdice/game_system/WorldsEndFrontline_Korean.rb +26 -0
  142. data/lib/bcdice/game_system/YearZeroEngine.rb +7 -7
  143. data/lib/bcdice/game_system/YearZeroEngine_Korean.rb +46 -0
  144. data/lib/bcdice/game_system/ZombiLine.rb +29 -36
  145. data/lib/bcdice/game_system/ZombiLine_Korean.rb +37 -0
  146. data/lib/bcdice/game_system/cthulhu7th_Korean/full_auto.rb +294 -0
  147. data/lib/bcdice/game_system/cthulhu7th_Korean/rollable.rb +43 -0
  148. data/lib/bcdice/game_system/meikyu_kingdom_basic/atoz_table.rb +1184 -0
  149. data/lib/bcdice/game_system/meikyu_kingdom_basic/randr236_table.rb +254 -0
  150. data/lib/bcdice/game_system/meikyu_kingdom_basic/table.rb +54 -0
  151. data/lib/bcdice/game_system/meikyu_kingdom_basic/tk_table.rb +755 -0
  152. data/lib/bcdice/game_system/sword_world/rating_options.rb +9 -0
  153. data/lib/bcdice/game_system/sword_world/rating_parsed.rb +19 -0
  154. data/lib/bcdice/game_system/sword_world/rating_parser.rb +229 -149
  155. data/lib/bcdice/game_system/sword_world/transcendent_test.rb +1 -0
  156. data/lib/bcdice/game_system.rb +47 -0
  157. data/lib/bcdice/version.rb +1 -1
  158. metadata +96 -2
@@ -0,0 +1,294 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BCDice
4
+ module GameSystem
5
+ class Cthulhu7th_Korean < Base
6
+ class FullAuto
7
+ BONUS_DICE_RANGE = (-2..2).freeze
8
+
9
+ # 連射処理を止める条件(難易度の閾値): 연사 처리를 중지하는 조건(난이도 임계값)
10
+ # @return [Hash<String, Integer>]
11
+ #
12
+ # 成功の種類の小文字表記 => 難易度の閾値 : 성공 유형의 소문자 표기 => 난이도 임계값
13
+ ROLL_FULL_AUTO_DIFFICULTY_THRESHOLD = {
14
+ # レギュラー : 보통 성공
15
+ "r" => 0,
16
+ # ハード : 어려운 성공
17
+ "h" => 1,
18
+ # イクストリーム : 극단적 성공
19
+ "e" => 2
20
+ }.freeze
21
+
22
+ def self.eval(command, randomizer)
23
+ new.eval(command, randomizer)
24
+ end
25
+
26
+ def eval(command, randomizer)
27
+ @randomizer = randomizer
28
+ get_full_auto_result(command)
29
+ end
30
+
31
+ private
32
+
33
+ include Rollable
34
+
35
+ def get_full_auto_result(command)
36
+ m = /^FAR\((-?\d+),(-?\d+),(-?\d+)(?:,(-?\d+)?)?(?:,(-?\w+)?)?(?:,(-?\d+)?)?\)$/i.match(command)
37
+ unless m
38
+ return nil
39
+ end
40
+
41
+ bullet_count = m[1].to_i
42
+ diff = m[2].to_i
43
+ broken_number = m[3].to_i
44
+ bonus_dice_count = m[4].to_i
45
+ stop_count = m[5]&.downcase || ""
46
+ bullet_set_count_cap = m[6]&.to_i || diff / 10
47
+
48
+ output = ""
49
+
50
+ # 最大で(8回*(PC技能値最大値/10))=72発しか撃てないはずなので上限 : 최대 (8회 * (PC 능력치 최대값 / 10)) = 72발밖에 쏠 수 없으므로 상한선
51
+ bullet_count_limit = 100
52
+ if bullet_count > bullet_count_limit
53
+ output += "탄환이 너무 많습니다. 장전된 탄환을 #{bullet_count_limit}발로 변경합니다.\n"
54
+ bullet_count = bullet_count_limit
55
+ end
56
+
57
+ # ボレーの上限の設定がおかしい場合の注意表示 : 연사 상한선 설정이 잘못된 경우의 주의 표시
58
+ if (bullet_set_count_cap > diff / 10) && (diff > 39) && !m[6].nil?
59
+ bullet_set_count_cap = diff / 10
60
+ output += "연사할 탄환 수의 상한은 [기능치÷10(소수점 버림)]발이므로, 그보다 큰 수를 지정할 수 없습니다. 연사할 탄환 수를 #{bullet_set_count_cap}발로 변경합니다.\n"
61
+ elsif (diff <= 39) && (bullet_set_count_cap > 3) && !m[6].nil?
62
+ bullet_set_count_cap = 3
63
+ output += "기능치가 39 이하일 때 연사할 탄환 수의 상한 및 하한은 3발입니다. 연사할 탄환 수를 #{bullet_set_count_cap}발로 변경합니다.\n"
64
+ end
65
+
66
+ # ボレーの下限の設定がおかしい場合の注意表示およびエラー表示 : 연사 하한값 설정이 잘못된 경우의 주의 표시 및 오류 표시
67
+ return "연사할 탄환 수는 양수여야 합니다." if (bullet_set_count_cap <= 0) && !m[6].nil?
68
+
69
+ if (bullet_set_count_cap < 3) && !m[6].nil?
70
+ bullet_set_count_cap = 3
71
+ output += "연사할 탄환 수의 하한은 3발입니다. 연사할 탄환 수를 3발로 변경합니다.\n"
72
+ end
73
+
74
+ return "탄환은 양수여야 합니다." if bullet_count <= 0
75
+ return "목표치는 양수여야 합니다." if diff <= 0
76
+
77
+ if broken_number < 0
78
+ output += "고장 수치는 양수여야 합니다. 마이너스 부호를 제외합니다.\n"
79
+ broken_number = broken_number.abs
80
+ end
81
+
82
+ unless BONUS_DICE_RANGE.include?(bonus_dice_count)
83
+ return "오류. 보너스, 페널티 주사위의 값은 #{BONUS_DICE_RANGE.min}~#{BONUS_DICE_RANGE.max}여야 합니다."
84
+ end
85
+
86
+ output += "보너스, 페널티 주사위[#{bonus_dice_count}]"
87
+ output += roll_full_auto(bullet_count, diff, broken_number, bonus_dice_count, stop_count, bullet_set_count_cap)
88
+
89
+ return output
90
+ end
91
+
92
+ def roll_full_auto(bullet_count, diff, broken_number, dice_num, stop_count, bullet_set_count_cap)
93
+ output = ""
94
+ loop_count = 0
95
+
96
+ counts = {
97
+ hit_bullet: 0,
98
+ impale_bullet: 0,
99
+ bullet: bullet_count,
100
+ }
101
+
102
+ # 難易度変更用ループ : 난이도 변경용 루프
103
+ 4.times do |more_difficulty|
104
+ output += get_next_difficulty_message(more_difficulty)
105
+
106
+ # ペナルティダイスを減らしながらロール用ループ : 페널티 주사위를 줄이면서 주사위를 굴리는 루프
107
+ while dice_num >= BONUS_DICE_RANGE.min
108
+
109
+ loop_count += 1
110
+ hit_result, total, total_list = get_hit_result_infos(dice_num, diff, more_difficulty)
111
+ output += "\n#{loop_count}번째: > #{total_list.join(', ')} > #{hit_result}"
112
+
113
+ if total >= broken_number
114
+ output += " 총알 걸림(고장)"
115
+ return get_hit_result_text(output, counts)
116
+ end
117
+
118
+ hit_type = get_hit_type(more_difficulty, hit_result)
119
+ hit_bullet, impale_bullet, lost_bullet = get_bullet_results(counts[:bullet], hit_type, diff, bullet_set_count_cap)
120
+
121
+ output += " (#{hit_bullet}발 명중, #{impale_bullet}발 관통)"
122
+
123
+ counts[:hit_bullet] += hit_bullet
124
+ counts[:impale_bullet] += impale_bullet
125
+ counts[:bullet] -= lost_bullet
126
+
127
+ return get_hit_result_text(output, counts) if counts[:bullet] <= 0
128
+
129
+ dice_num -= 1
130
+ end
131
+
132
+ # 指定された難易度となった場合、連射処理を途中で止める : 지정된 난이도에 도달하면 연사 처리를 중단
133
+ if should_stop_roll_full_auto?(stop_count, more_difficulty)
134
+ output += "\n【지정한 난이도가 되었으므로, 처리를 종료합니다.】"
135
+ break
136
+ end
137
+
138
+ dice_num += 1
139
+ end
140
+
141
+ return get_hit_result_text(output, counts)
142
+ end
143
+
144
+ # 連射処理を止めるべきかどうかを返す : 연사 처리를 중지해야 하는지 여부를 반환
145
+ # @param [String] stop_count 成功の種類
146
+ # @param [Integer] difficulty 難易度
147
+ # @return [Boolean]
148
+ def should_stop_roll_full_auto?(stop_count, difficulty)
149
+ difficulty_threshold = ROLL_FULL_AUTO_DIFFICULTY_THRESHOLD[stop_count]
150
+ return difficulty_threshold && difficulty >= difficulty_threshold
151
+ end
152
+
153
+ def get_hit_result_infos(dice_num, diff, more_difficulty)
154
+ total, total_list = roll_with_bonus(dice_num)
155
+
156
+ fumbleable = get_fumbleable(more_difficulty)
157
+ hit_result = ResultLevel.from_values(total, diff, fumbleable).to_s
158
+
159
+ return hit_result, total, total_list
160
+ end
161
+
162
+ def get_hit_result_text(output, counts)
163
+ return "#{output}\n> #{counts[:hit_bullet]}발 명중, #{counts[:impale_bullet]}발 관통, 남은 탄환 #{counts[:bullet]}발"
164
+ end
165
+
166
+ def get_hit_type(more_difficulty, hit_result)
167
+ success_list, impale_bullet_list = get_success_list_impale_bullet_list(more_difficulty)
168
+
169
+ return :hit if success_list.include?(hit_result)
170
+ return :impale if impale_bullet_list.include?(hit_result)
171
+
172
+ return ""
173
+ end
174
+
175
+ def get_bullet_results(bullet_count, hit_type, diff, bullet_set_count_cap)
176
+ bullet_set_count = get_set_of_bullet(diff, bullet_set_count_cap)
177
+ hit_bullet_count_base = get_hit_bullet_count_base(diff, bullet_set_count)
178
+ impale_bullet_count_base = (bullet_set_count / 2.to_f)
179
+
180
+ lost_bullet_count = 0
181
+ hit_bullet_count = 0
182
+ impale_bullet_count = 0
183
+
184
+ if !last_bullet_turn?(bullet_count, bullet_set_count)
185
+
186
+ case hit_type
187
+ when :hit
188
+ hit_bullet_count = hit_bullet_count_base # 通常命中した弾数の計算 : 명중한 탄환 수 계산
189
+
190
+ when :impale
191
+ impale_bullet_count = impale_bullet_count_base.floor # 貫通した弾数の計算 : 관통한 탄환 수 계산
192
+ hit_bullet_count = impale_bullet_count_base.ceil
193
+ end
194
+
195
+ lost_bullet_count = bullet_set_count
196
+
197
+ else
198
+
199
+ case hit_type
200
+ when :hit
201
+ hit_bullet_count = get_last_hit_bullet_count(bullet_count)
202
+
203
+ when :impale
204
+ impale_bullet_count = get_last_hit_bullet_count(bullet_count)
205
+ hit_bullet_count = bullet_count - impale_bullet_count
206
+ end
207
+
208
+ lost_bullet_count = bullet_count
209
+ end
210
+
211
+ return hit_bullet_count, impale_bullet_count, lost_bullet_count
212
+ end
213
+
214
+ def get_success_list_impale_bullet_list(more_difficulty)
215
+ success_list = []
216
+ impale_bullet_list = []
217
+
218
+ case more_difficulty
219
+ when 0
220
+ success_list = ["어려운 성공", "보통 성공"]
221
+ impale_bullet_list = ["대성공", "극단적 성공"]
222
+ when 1
223
+ success_list = ["어려운 성공"]
224
+ impale_bullet_list = ["대성공", "극단적 성공"]
225
+ when 2
226
+ success_list = []
227
+ impale_bullet_list = ["대성공", "극단적 성공"]
228
+ when 3
229
+ success_list = ["대성공"]
230
+ impale_bullet_list = []
231
+ end
232
+
233
+ return success_list, impale_bullet_list
234
+ end
235
+
236
+ def get_next_difficulty_message(more_difficulty)
237
+ case more_difficulty
238
+ when 1
239
+ return "\n【난이도를 어려운 성공으로 변경】"
240
+ when 2
241
+ return "\n【난이도를 극단적 성공으로 변경】"
242
+ when 3
243
+ return "\n【난이도를 대성공으로 변경】"
244
+ end
245
+
246
+ return ""
247
+ end
248
+
249
+ def get_set_of_bullet(diff, bullet_set_count_cap)
250
+ bullet_set_count = diff / 10
251
+
252
+ if bullet_set_count_cap < bullet_set_count
253
+ bullet_set_count = bullet_set_count_cap
254
+ end
255
+
256
+ if (diff >= 1) && (diff < 30)
257
+ bullet_set_count = 3 # 技能値が29以下での最低値保障処理 : 기능치가 29 이하일 때의 최저치 보장 처리
258
+ end
259
+
260
+ return bullet_set_count
261
+ end
262
+
263
+ def get_hit_bullet_count_base(diff, bullet_set_count)
264
+ hit_bullet_count_base = (bullet_set_count / 2)
265
+
266
+ if (diff >= 1) && (diff < 30)
267
+ hit_bullet_count_base = 1 # 技能値29以下での最低値保障 : 기능치 29 이하일 때의 최저치 보장
268
+ end
269
+
270
+ return hit_bullet_count_base
271
+ end
272
+
273
+ def last_bullet_turn?(bullet_count, bullet_set_count)
274
+ ((bullet_count - bullet_set_count) < 0)
275
+ end
276
+
277
+ def get_last_hit_bullet_count(bullet_count)
278
+ # 残弾1での最低値保障処理 : 잔탄 1개일 때의 최저치 보장 처리
279
+ if bullet_count == 1
280
+ return 1
281
+ end
282
+
283
+ count = (bullet_count / 2.to_f).floor
284
+ return count
285
+ end
286
+
287
+ def get_fumbleable(more_difficulty)
288
+ # 成功が49以下の出目のみとなるため、ファンブル値は上昇 : 성공이 49 이하일 때만 적용되므로, 펌블치 상승
289
+ return (more_difficulty >= 1)
290
+ end
291
+ end
292
+ end
293
+ end
294
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BCDice
4
+ module GameSystem
5
+ class Cthulhu7th_Korean < Base
6
+ module Rollable
7
+ private
8
+
9
+ # 1D100の一の位用のダイスロール
10
+ # 0から9までの値を返す
11
+ #
12
+ # @return [Integer]
13
+ def roll_ones_d10
14
+ dice = @randomizer.roll_once(10)
15
+ return 0 if dice == 10
16
+
17
+ return dice
18
+ end
19
+
20
+ # @param bonus [Integer] ボーナス・ペナルティダイスの数。負の数ならペナルティダイス。
21
+ # @return [Array<(Integer, Array<Integer>)>]
22
+ def roll_with_bonus(bonus)
23
+ tens_list = Array.new(bonus.abs + 1) { @randomizer.roll_tens_d10 }
24
+ ones = roll_ones_d10()
25
+
26
+ dice_list = tens_list.map do |tens|
27
+ dice = tens + ones
28
+ dice == 0 ? 100 : dice
29
+ end
30
+
31
+ dice =
32
+ if bonus >= 0
33
+ dice_list.min
34
+ else
35
+ dice_list.max
36
+ end
37
+
38
+ return dice, dice_list
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end