Skip to content

Commit fb6a9d5

Browse files
committed
MorkBorg:韓国語対応を追加 & i18n化
1 parent 9e53076 commit fb6a9d5

6 files changed

Lines changed: 526 additions & 41 deletions

File tree

i18n/MorkBorg/ja_jp.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
ja_jp:
2+
MorkBorg:
3+
fumble: "Fumble"
4+
succeed: "Succeed"
5+
failure_text: "Failure"
6+
crit: "Crit"
7+
pcs_go_first: "PCs go first"
8+
enemies_go_first: "Enemies go first"
9+
maintained: "Maintained"
10+
flees: "(Flees)"
11+
surrenders: "(Surrenders)"
12+
ERT:
13+
name: "遭遇反応表"
14+
type: "2D6"
15+
items:
16+
- "Kill!"
17+
- "Kill!"
18+
- "Angered"
19+
- "Angered"
20+
- "Angered"
21+
- "Indifferent"
22+
- "Indifferent"
23+
- "Almost friendly"
24+
- "Almost friendly"
25+
- "Helpful"
26+
- "Helpful"
27+
BRO:
28+
name: "崩壊表"
29+
type: "1D4"
30+
items:
31+
- "Fall unconscious for d4 rounds, awaken with d4 HP."
32+
- "Roll a d6: 1–5 = Broken or severed limb. 6 = Lost eye. Can't act for d4 rounds then become active with d4 HP."
33+
- "Haemorrhage: death in d2 hours unless treated. All tests are DR16 the first hour. DR18 the last hour."
34+
- "Dead."

i18n/MorkBorg/ko_kr.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
ko_kr:
2+
MorkBorg:
3+
fumble: "펌블"
4+
succeed: "성공"
5+
failure_text: "실패"
6+
crit: "크리티컬"
7+
pcs_go_first: "PC 선공"
8+
enemies_go_first: "적 선공"
9+
maintained: "모럴 유지"
10+
flees: "(도주)"
11+
surrenders: "(항복)"
12+
ERT:
13+
name: "조우 반응표"
14+
type: "2D6"
15+
items:
16+
- "Kill!"
17+
- "Kill!"
18+
- "Angered"
19+
- "Angered"
20+
- "Angered"
21+
- "Indifferent"
22+
- "Indifferent"
23+
- "Almost friendly"
24+
- "Almost friendly"
25+
- "Helpful"
26+
- "Helpful"
27+
BRO:
28+
name: "붕괴표"
29+
type: "1D4"
30+
items:
31+
- "Fall unconscious for d4 rounds, awaken with d4 HP."
32+
- "Roll a d6: 1–5 = Broken or severed limb. 6 = Lost eye. Can't act for d4 rounds then become active with d4 HP."
33+
- "Haemorrhage: death in d2 hours unless treated. All tests are DR16 the first hour. DR18 the last hour."
34+
- "Dead."

lib/bcdice/game_system.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
require "bcdice/game_system/MonotoneMuseum"
179179
require "bcdice/game_system/MonotoneMuseum_Korean"
180180
require "bcdice/game_system/MorkBorg"
181+
require "bcdice/game_system/MorkBorg_Korean"
181182
require "bcdice/game_system/Nechronica"
182183
require "bcdice/game_system/Nechronica_Korean"
183184
require "bcdice/game_system/NeonUnderRealm"

lib/bcdice/game_system/MorkBorg.rb

Lines changed: 22 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ def initialize(command)
4444
end
4545

4646
def eval_game_system_specific_command(command)
47-
resolute_action(command) || resolute_initiative(command) || resolute_morale(command) || roll_tables(command, TABLES)
47+
resolute_action(command) || resolute_initiative(command) || resolute_morale(command) || roll_tables(command, self.class::TABLES)
4848
end
4949

5050
private
5151

5252
def result_dr(total, dice_total, target)
5353
if dice_total <= 1
54-
Result.fumble("Fumble")
54+
Result.fumble(translate('MorkBorg.fumble'))
5555
elsif dice_total >= 20
56-
Result.critical("Crit")
56+
Result.critical(translate('MorkBorg.crit'))
5757
elsif total >= target
58-
Result.success("Succeed")
58+
Result.success(translate('MorkBorg.succeed'))
5959
else
60-
Result.failure("Failure")
60+
Result.failure(translate('MorkBorg.failure_text'))
6161
end
6262
end
6363

@@ -109,9 +109,9 @@ def resolute_initiative(command)
109109
total = die + num_status
110110
result =
111111
if total >= 4
112-
Result.success("PCs go first")
112+
Result.success(translate('MorkBorg.pcs_go_first'))
113113
else
114-
Result.failure("Enemies go first")
114+
Result.failure(translate('MorkBorg.enemies_go_first'))
115115
end
116116

117117
result.text = "(#{command}) > #{die}#{with_symbol(num_status)}#{total}#{result.text}"
@@ -135,13 +135,13 @@ def resolute_morale(command)
135135
die = ""
136136
result =
137137
if total <= num_target
138-
Result.failure("Maintained")
138+
Result.failure(translate('MorkBorg.maintained'))
139139
else
140140
die = @randomizer.roll_once(6)
141141
if die >= 4
142-
Result.success("(Surrenders)")
142+
Result.success(translate('MorkBorg.surrenders'))
143143
else
144-
Result.success("(Flees)")
144+
Result.success(translate('MorkBorg.flees'))
145145
end
146146
end
147147
result.text = "(#{command}) > #{dice_total}#{with_symbol(num_status)}#{total}#{die}#{result.text}"
@@ -151,37 +151,18 @@ def resolute_morale(command)
151151

152152
# 各種表
153153

154-
TABLES = {
155-
# 無理に高度なことをしなくても、表は展開して実装しても動く
156-
'ERT' => DiceTable::Table.new(
157-
'遭遇反応表',
158-
'2D6',
159-
[
160-
'Kill!',
161-
'Kill!',
162-
'Angered',
163-
'Angered',
164-
'Angered',
165-
'Indifferent',
166-
'Indifferent',
167-
'Almost friendly',
168-
'Almost friendly',
169-
'Helpful',
170-
'Helpful',
171-
]
172-
),
173-
174-
'BRO' => DiceTable::Table.new(
175-
'崩壊表',
176-
'1D4',
177-
[
178-
"Fall unconscious for d4 rounds, awaken with d4 HP.",
179-
"Roll a d6: 1–5 = Broken or severed limb. 6 = Lost eye. Can't act for d4 rounds then become active with d4 HP.",
180-
"Haemorrhage: death in d2 hours unless treated. All tests are DR16 the first hour. DR18 the last hour.",
181-
"Dead.",
182-
]
183-
),
184-
}.freeze
154+
class << self
155+
private
156+
157+
def translate_tables(locale)
158+
{
159+
'ERT' => DiceTable::Table.from_i18n('MorkBorg.ERT', locale),
160+
'BRO' => DiceTable::Table.from_i18n('MorkBorg.BRO', locale),
161+
}
162+
end
163+
end
164+
165+
TABLES = translate_tables(:ja_jp).freeze
185166

186167
register_prefix('([+-]?\d+)?DR[\d]+', '([+-]?\d+)?INS', '([+-]?\d+)?MOR', TABLES.keys)
187168
end
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# frozen_string_literal: true
2+
3+
require 'bcdice/game_system/MorkBorg'
4+
5+
module BCDice
6+
module GameSystem
7+
class MorkBorg_Korean < MorkBorg
8+
# ゲームシステムの識別子
9+
ID = 'MorkBorg:Korean'
10+
11+
# ゲームシステム名
12+
NAME = '모크 보그(MÖRK BORG)'
13+
14+
# ゲームシステム名の読みがな
15+
SORT_KEY = '国際化:Korean:모크 보그(MÖRK BORG)'
16+
17+
# ダイスボットの使い方
18+
HELP_MESSAGE = <<~INFO_MESSAGETEXT
19+
■판정 sDRt s: 능력치(생략 시:0) t:목표값
20+
21+
예)+3DR12: 능력치+3, DR12로 1d20을 굴려서 결과 표시(크리티컬·펌블도 표시)
22+
23+
■이니셔티브 sINS s: 능력치(생략 시:0. 개별 이니셔티브를 사용하는 경우)
24+
25+
예)INS: 1d6을 굴려서 이니셔티브 결과 표시(PC 선공을 성공으로 표시)
26+
27+
■모럴 sMORt s: 능력치(생략 시:0) t:상대 크리처의 모럴 값
28+
29+
예)MOR8: 2d6을 굴려서 모럴 판정 결과 표시(모럴 붕괴를 성공으로 표시)
30+
31+
32+
■각종 표
33+
34+
・조우 반응표 Reaction (ERT)
35+
・붕괴표 Broken (BRO)
36+
37+
INFO_MESSAGETEXT
38+
39+
def initialize(command)
40+
super(command)
41+
@locale = :ko_kr
42+
end
43+
44+
TABLES = translate_tables(:ko_kr).freeze
45+
46+
register_prefix_from_super_class()
47+
end
48+
end
49+
end

0 commit comments

Comments
 (0)