bcdice 3.16.1 → 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 (149) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +111 -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/Dracurouge/ko_kr.yml +1284 -205
  15. data/i18n/Emoklore/ja_jp.yml +1 -0
  16. data/i18n/Emoklore/ko_kr.yml +1 -0
  17. data/i18n/FutariSousa/ja_jp.yml +70 -0
  18. data/i18n/FutariSousa/ko_kr.yml +157 -0
  19. data/i18n/HatsuneMiku/ja_jp.yml +579 -0
  20. data/i18n/HatsuneMiku/ko_kr.yml +579 -0
  21. data/i18n/Irisbane/ja_jp.yml +27 -0
  22. data/i18n/Irisbane/ko_kr.yml +27 -0
  23. data/i18n/JuinKansen/ja_jp.yml +168 -0
  24. data/i18n/JuinKansen/ko_kr.yml +168 -0
  25. data/i18n/KemonoNoMori/ja_jp.yml +229 -0
  26. data/i18n/KemonoNoMori/ko_kr.yml +229 -0
  27. data/i18n/KizunaBullet/ko_kr.yml +653 -0
  28. data/i18n/MagicPunk/ja_jp.yml +5 -0
  29. data/i18n/MagicPunk/ko_kr.yml +5 -0
  30. data/i18n/MorkBorg/ja_jp.yml +34 -0
  31. data/i18n/MorkBorg/ko_kr.yml +34 -0
  32. data/i18n/Nechronica/ko_kr.yml +43 -0
  33. data/i18n/NegikureNegimaki/ja_jp.yml +6 -0
  34. data/i18n/NegikureNegimaki/ko_kr.yml +6 -0
  35. data/i18n/Nuekagami/ja_jp.yml +219 -0
  36. data/i18n/Nuekagami/ko_kr.yml +219 -0
  37. data/i18n/Revulture/ja_jp.yml +8 -0
  38. data/i18n/Revulture/ko_kr.yml +8 -0
  39. data/i18n/SRS/ja_jp.yml +4 -0
  40. data/i18n/SRS/ko_kr.yml +4 -0
  41. data/i18n/ShinobiGami/ja_jp.yml +879 -0
  42. data/i18n/ShinobiGami/ko_kr.yml +876 -0
  43. data/i18n/StarryDolls/ja_jp.yml +456 -0
  44. data/i18n/StarryDolls/ko_kr.yml +456 -0
  45. data/i18n/StratoShout/ja_jp.yml +8 -8
  46. data/i18n/SwordWorld2_5/ja_jp.yml +48 -0
  47. data/i18n/Ventangle/ja_jp.yml +4 -0
  48. data/i18n/Ventangle/ko_kr.yml +4 -0
  49. data/i18n/YearZeroEngine/ja_jp.yml +12 -0
  50. data/i18n/YearZeroEngine/ko_kr.yml +12 -0
  51. data/i18n/ZombiLine/ja_jp.yml +27 -0
  52. data/i18n/ZombiLine/ko_kr.yml +27 -0
  53. data/i18n/ko_kr.yml +2 -0
  54. data/i18n/zh_hant.yml +2 -2
  55. data/lib/bcdice/dice_table/d66_left_range_table.rb +21 -0
  56. data/lib/bcdice/game_system/Aionia.rb +68 -19
  57. data/lib/bcdice/game_system/Airgetlamh.rb +64 -41
  58. data/lib/bcdice/game_system/Airgetlamh_Korean.rb +53 -0
  59. data/lib/bcdice/game_system/Alsetto.rb +63 -50
  60. data/lib/bcdice/game_system/Alsetto_Korean.rb +51 -0
  61. data/lib/bcdice/game_system/AnimaAnimus.rb +15 -32
  62. data/lib/bcdice/game_system/AnimaAnimus_Korean.rb +39 -0
  63. data/lib/bcdice/game_system/BlackJacket.rb +57 -113
  64. data/lib/bcdice/game_system/BlackJacket_Korean.rb +8 -206
  65. data/lib/bcdice/game_system/Bloodorium.rb +1 -1
  66. data/lib/bcdice/game_system/Bloodorium_Korean.rb +34 -0
  67. data/lib/bcdice/game_system/ChroniclesOfDarkness2e.rb +163 -0
  68. data/lib/bcdice/game_system/Cthulhu7th_Korean.rb +471 -300
  69. data/lib/bcdice/game_system/DeadlineHeroes_Korean.rb +273 -0
  70. data/lib/bcdice/game_system/Dracurouge_Korean.rb +25 -19
  71. data/lib/bcdice/game_system/DungeonsAndDragons5.rb +106 -73
  72. data/lib/bcdice/game_system/DungeonsAndDragons5_Korean.rb +53 -0
  73. data/lib/bcdice/game_system/DungeonsAndDragons_Korean.rb +61 -0
  74. data/lib/bcdice/game_system/Emoklore.rb +34 -9
  75. data/lib/bcdice/game_system/Emoklore_Korean.rb +10 -2
  76. data/lib/bcdice/game_system/FateCoreSystem.rb +10 -6
  77. data/lib/bcdice/game_system/FullMetalPanic_Korean.rb +28 -0
  78. data/lib/bcdice/game_system/FutariSousa.rb +37 -12
  79. data/lib/bcdice/game_system/FutariSousa_Korean.rb +25 -8
  80. data/lib/bcdice/game_system/GaiaCare.rb +40 -0
  81. data/lib/bcdice/game_system/GardenOrder.rb +2 -2
  82. data/lib/bcdice/game_system/GardenOrderReEdit.rb +849 -0
  83. data/lib/bcdice/game_system/GardenOrder_Korean.rb +839 -0
  84. data/lib/bcdice/game_system/HatsuneMiku.rb +51 -605
  85. data/lib/bcdice/game_system/HatsuneMiku_Korean.rb +56 -0
  86. data/lib/bcdice/game_system/HunterTheReckoning5th.rb +15 -11
  87. data/lib/bcdice/game_system/Irisbane.rb +17 -30
  88. data/lib/bcdice/game_system/Irisbane_Korean.rb +52 -0
  89. data/lib/bcdice/game_system/JuinKansen.rb +41 -208
  90. data/lib/bcdice/game_system/JuinKansen_Korean.rb +8 -213
  91. data/lib/bcdice/game_system/KemonoNoMori.rb +67 -276
  92. data/lib/bcdice/game_system/KemonoNoMori_Korean.rb +62 -0
  93. data/lib/bcdice/game_system/KinAriel.rb +117 -0
  94. data/lib/bcdice/game_system/KizunaBullet_Korean.rb +109 -0
  95. data/lib/bcdice/game_system/KutuluRevised.rb +94 -0
  96. data/lib/bcdice/game_system/LiverLabyrinth.rb +321 -0
  97. data/lib/bcdice/game_system/Lost.rb +89 -0
  98. data/lib/bcdice/game_system/MagicPunk.rb +85 -0
  99. data/lib/bcdice/game_system/MagicPunk_Korean.rb +39 -0
  100. data/lib/bcdice/game_system/MarvelHeroicRoleplaying.rb +144 -0
  101. data/lib/bcdice/game_system/MetallicGuardian_Korean.rb +28 -0
  102. data/lib/bcdice/game_system/MorkBorg.rb +170 -0
  103. data/lib/bcdice/game_system/MorkBorg_Korean.rb +49 -0
  104. data/lib/bcdice/game_system/NanimonaiMura.rb +112 -0
  105. data/lib/bcdice/game_system/Nechronica_Korean.rb +6 -6
  106. data/lib/bcdice/game_system/NegikureNegimaki.rb +140 -0
  107. data/lib/bcdice/game_system/NegikureNegimaki_Korean.rb +48 -0
  108. data/lib/bcdice/game_system/NeonUnderRealm.rb +122 -0
  109. data/lib/bcdice/game_system/NinjaSlayer2.rb +170 -49
  110. data/lib/bcdice/game_system/Nuekagami.rb +19 -261
  111. data/lib/bcdice/game_system/Nuekagami_Korean.rb +43 -0
  112. data/lib/bcdice/game_system/ParanoiaPerfect.rb +74 -0
  113. data/lib/bcdice/game_system/PastFutureParadox.rb +2245 -55
  114. data/lib/bcdice/game_system/PreciousDays.rb +170 -0
  115. data/lib/bcdice/game_system/Revulture.rb +8 -5
  116. data/lib/bcdice/game_system/Revulture_Korean.rb +7 -81
  117. data/lib/bcdice/game_system/Ryutama.rb +46 -46
  118. data/lib/bcdice/game_system/SRS.rb +4 -4
  119. data/lib/bcdice/game_system/SRS_Korean.rb +67 -0
  120. data/lib/bcdice/game_system/ShinobiGami.rb +154 -1047
  121. data/lib/bcdice/game_system/ShinobiGami_Korean.rb +102 -0
  122. data/lib/bcdice/game_system/StarryDolls.rb +70 -508
  123. data/lib/bcdice/game_system/StarryDolls_Korean.rb +80 -0
  124. data/lib/bcdice/game_system/StratoShout.rb +1 -1
  125. data/lib/bcdice/game_system/SwordWorld.rb +28 -2
  126. data/lib/bcdice/game_system/SwordWorld2_0.rb +1 -1
  127. data/lib/bcdice/game_system/SwordWorld2_5.rb +67 -3
  128. data/lib/bcdice/game_system/TacticalExorcist.rb +222 -0
  129. data/lib/bcdice/game_system/TenkaRyouran_Korean.rb +30 -0
  130. data/lib/bcdice/game_system/VampireTheMasquerade5th.rb +38 -33
  131. data/lib/bcdice/game_system/Ventangle.rb +8 -7
  132. data/lib/bcdice/game_system/Ventangle_Korean.rb +6 -95
  133. data/lib/bcdice/game_system/Warhammer4.rb +202 -6
  134. data/lib/bcdice/game_system/WerewolfTheApocalypse5th.rb +20 -15
  135. data/lib/bcdice/game_system/WorldEndScrapyard.rb +333 -0
  136. data/lib/bcdice/game_system/WorldsEndFrontline_Korean.rb +26 -0
  137. data/lib/bcdice/game_system/YearZeroEngine.rb +7 -7
  138. data/lib/bcdice/game_system/YearZeroEngine_Korean.rb +46 -0
  139. data/lib/bcdice/game_system/ZombiLine.rb +29 -36
  140. data/lib/bcdice/game_system/ZombiLine_Korean.rb +37 -0
  141. data/lib/bcdice/game_system/cthulhu7th_Korean/full_auto.rb +294 -0
  142. data/lib/bcdice/game_system/cthulhu7th_Korean/rollable.rb +43 -0
  143. data/lib/bcdice/game_system/sword_world/rating_options.rb +9 -0
  144. data/lib/bcdice/game_system/sword_world/rating_parsed.rb +19 -0
  145. data/lib/bcdice/game_system/sword_world/rating_parser.rb +229 -149
  146. data/lib/bcdice/game_system/sword_world/transcendent_test.rb +1 -0
  147. data/lib/bcdice/game_system.rb +42 -0
  148. data/lib/bcdice/version.rb +1 -1
  149. metadata +87 -2
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bcdice/game_system/ZombiLine'
4
+
5
+ module BCDice
6
+ module GameSystem
7
+ class ZombiLine_Korean < ZombiLine
8
+ # ゲームシステムの識別子
9
+ ID = "ZombiLine:Korean"
10
+
11
+ # ゲームシステム名
12
+ NAME = "좀비 라인"
13
+
14
+ # ゲームシステム名の読みがな
15
+ SORT_KEY = "国際化:Korean:좀비 라인"
16
+
17
+ HELP_MESSAGE = <<~TEXT
18
+ ■ 판정 (xZL<=y)
19
+  x:주사위 개수(생략 시 1)
20
+  y:성공률
21
+
22
+ ■ 각종 표
23
+  스트레스 증상표 SST
24
+  식재료 표 IT
25
+ TEXT
26
+
27
+ register_prefix_from_super_class()
28
+
29
+ def initialize(command)
30
+ super(command)
31
+ @locale = :ko_kr
32
+ end
33
+
34
+ TABLES = translate_tables(:ko_kr).freeze
35
+ end
36
+ end
37
+ end
@@ -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
@@ -22,6 +22,9 @@ module BCDice
22
22
  # @return [Integer, nil]
23
23
  attr_accessor :rateup
24
24
 
25
+ # @return [Integer, nil]
26
+ attr_accessor :add_damage
27
+
25
28
  # @return [Boolean, nil]
26
29
  attr_accessor :greatest_fortune
27
30
 
@@ -31,6 +34,9 @@ module BCDice
31
34
  # @return [Integer, nil]
32
35
  attr_accessor :tmp_fixed_val
33
36
 
37
+ # @return [Integer, nil]
38
+ attr_accessor :set_zero_val
39
+
34
40
  # @return [Integer, nil]
35
41
  attr_accessor :modifier
36
42
 
@@ -40,6 +46,9 @@ module BCDice
40
46
  # @return [Integer, nil]
41
47
  attr_accessor :modifier_after_one_and_a_half
42
48
 
49
+ # @return [Integer, nil]
50
+ attr_accessor :modifier_after_double
51
+
43
52
  def settable_first_roll_adjust_option?
44
53
  return first_modify.nil? && first_to.nil? && first_modify_ssp.nil?
45
54
  end
@@ -25,6 +25,9 @@ module BCDice
25
25
  # @return [Integer]
26
26
  attr_accessor :rateup
27
27
 
28
+ # @return [Integer]
29
+ attr_accessor :add_damage
30
+
28
31
  # @return [Boolean]
29
32
  attr_accessor :greatest_fortune
30
33
 
@@ -34,6 +37,9 @@ module BCDice
34
37
  # @return [Integer]
35
38
  attr_accessor :tmp_fixed_val
36
39
 
40
+ # @return [Integer]
41
+ attr_accessor :set_zero_val
42
+
37
43
  # @return [Integer]
38
44
  attr_accessor :modifier
39
45
 
@@ -43,6 +49,9 @@ module BCDice
43
49
  # @return [Integer, nil]
44
50
  attr_accessor :modifier_after_one_and_a_half
45
51
 
52
+ # @return [Integer, nil]
53
+ attr_accessor :modifier_after_double
54
+
46
55
  def initialize(rate, modifier)
47
56
  @rate = rate
48
57
  @modifier = modifier
@@ -53,10 +62,13 @@ module BCDice
53
62
  @first_modify_ssp = 0
54
63
  @greatest_fortune = false
55
64
  @rateup = 0
65
+ @add_damage = 0
56
66
  @semi_fixed_val = 0
57
67
  @tmp_fixed_val = 0
68
+ @set_zero_val = 0
58
69
  @modifier_after_half = nil
59
70
  @modifier_after_one_and_a_half = nil
71
+ @modifier_after_double = nil
60
72
  end
61
73
 
62
74
  # @return [Boolean]
@@ -69,6 +81,11 @@ module BCDice
69
81
  return !@modifier_after_one_and_a_half.nil?
70
82
  end
71
83
 
84
+ # @return [Boolean]
85
+ def double
86
+ return !@modifier_after_double.nil?
87
+ end
88
+
72
89
  # @return [Integer]
73
90
  def min_critical
74
91
  if @semi_fixed_val <= 1
@@ -92,9 +109,11 @@ module BCDice
92
109
  output += "m[~#{Format.modifier(first_modify_ssp)}]" if first_modify_ssp != 0
93
110
  output += "m[#{first_to}]" if first_to != 0
94
111
  output += "r[#{rateup}]" if rateup != 0
112
+ output += "ad[#{add_damage}]" if add_damage != 0
95
113
  output += "gf" if @greatest_fortune
96
114
  output += "sf[#{semi_fixed_val}]" if semi_fixed_val != 0
97
115
  output += "tf[#{tmp_fixed_val}]" if tmp_fixed_val != 0
116
+ output += "sz[#{set_zero_val}]" if set_zero_val != 0
98
117
  output += "a[#{Format.modifier(kept_modify)}]" if kept_modify != 0
99
118
 
100
119
  if @modifier != 0