@@ -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
0 commit comments