diff --git a/terminal.lua b/terminal.lua --- a/terminal.lua +++ b/terminal.lua @@ -307,11 +307,11 @@ room { if s.status == 'command' then return s.path .. '>' .. s.entry .. '_'; elseif s.status == 'crypt' or s.status == 'connect' then - return translate_now(computer_locale, 'query_password') .. entry .. '_'; + return translate_now("terminal_locale", 'query_password') .. entry .. '_'; elseif s.status == 'format' then - return translate_now(computer_locale, 'query_type_yes') .. entry .. '_'; + return translate_now("terminal_locale", 'query_type_yes') .. entry .. '_'; elseif s.status == 'wait_format' then - return translate_now(computer_locale, 'query_formatting') .. " " .. tostring(s.format_percent) .. '%'; + return translate_now("terminal_locale", 'query_formatting') .. " " .. tostring(s.format_percent) .. '%'; elseif s.status == 'format_done' then end; return ''; @@ -320,12 +320,12 @@ room { command_preprocessor = function(s, command) if s.status == 'crypt' then s.status = 'command'; - s:push(translate_now(computer_locale, 'query_password') .. command); + s:push(translate_now("terminal_locale", 'query_password') .. command); if command == password1 then s:push(password2); s:push(''); else - s:push(translate_now(computer_locale, 'invalid_password')); + s:push(translate_now("terminal_locale", 'invalid_password')); s:push(''); end; s.entry = ''; @@ -333,7 +333,7 @@ room { elseif s.status == 'connect' then s.entry = ''; s.status = 'command'; - s:push(translate_now(computer_locale, 'query_password') .. command); + s:push(translate_now("terminal_locale", 'query_password') .. command); if command == password2 then if irradiated then snd.music('sound/bgm_ending_space_irradiated.ogg'); @@ -347,20 +347,20 @@ room { end; else - s:push(translate_now(computer_locale, 'invalid_password_2')); + s:push(translate_now("terminal_locale", 'invalid_password_2')); end; return true; elseif s.status == 'format' then s.status = 'format'; s.entry = ''; - s:push(translate_now(computer_locale, 'query_type_yes') .. command); + s:push(translate_now("terminal_locale", 'query_type_yes') .. command); --s:push("Type 'Yes' to confirm:" .. command); if command:lower() == 'yes' then s.status = 'wait_format'; timer:set(25); else - s:push(translate_now(computer_locale, 'operation_cancelled')); + s:push(translate_now("terminal_locale", 'operation_cancelled')); s.status = 'command'; end; @@ -378,12 +378,12 @@ room { d:replace_line(s:query_formatter(s.path, s.entry)); else s.status = 'format_done'; - s:push(translate_now(computer_locale, 'formatting_complete')); + s:push(translate_now("terminal_locale", 'formatting_complete')); end; return false; elseif s.status == 'format_done' then if s.format_percent < 120 then - s:push(translate_now(computer_locale, 'critical_failure')); + s:push(translate_now("terminal_locale", 'critical_failure')); end; s.format_percent = s.format_percent + 1; @@ -421,11 +421,11 @@ room { s.history = {}; s:process_directory_structure(s.directory_structure['C:']); - s:push(translate_now(computer_locale, 'starting_tower')); + s:push(translate_now("terminal_locale", 'tower_os_line_1')); s:push(''); - s:push(translate_now(computer_locale, 'tower_version')); + s:push(translate_now("terminal_locale", 'tower_os_line_2')); s:push(''); - s:push(translate_now(computer_locale, 'type_help')); + s:push(translate_now("terminal_locale", 'tower_os_line_3')); s:push(''); s:makekeyboard(); @@ -819,17 +819,17 @@ room { ['DOCS'] = { ['PASSWORD.TXT'] = function(s, command, args) if command == 'PRINT.COM' then - s:push(translate_now(computer_locale, 'binary_data')); + s:push(translate_now("terminal_locale", 'binary_data')); else - s:push(translate_now(computer_locale, 'bad_command')); + s:push(translate_now("terminal_locale", 'bad_command')); end; end; ['CRYPT.COM'] = function(s, command, args) if command == 'PRINT.COM' then - s:push(translate_now(computer_locale, 'binary_data')); + s:push(translate_now("terminal_locale", 'binary_data')); elseif command == '' then if not args then - s:push(translate_now(computer_locale, 'crypt_usage')); + s:push(translate_now("terminal_locale", 'crypt_usage')); else local new_args = {}; for i in string.gmatch(args, "%S+") do @@ -839,10 +839,10 @@ room { end; if #new_args > 2 then - s:push(translate_now(computer_locale, 'crypt_usage')); + s:push(translate_now("terminal_locale", 'crypt_usage')); return elseif #new_args < 2 then - s:push(translate_now(computer_locale, 'crypt_key_unset')); + s:push(translate_now("terminal_locale", 'crypt_key_unset')); return; end; local name, path; @@ -851,15 +851,15 @@ room { if name ~= nil and path == 'C:\\DOCS\\PASSWORD.TXT' then name, path = s:walk_directory(new_args[2], true); if name ~= nil and path == 'C:\\DOCS\\KEY.TXT' then - s:push(translate_now(computer_locale, 'crypt_key_locked')); + s:push(translate_now("terminal_locale", 'crypt_key_locked')); s.status = 'crypt'; return true; else - s:push(translate_now(computer_locale, 'crypt_invalid_key')); + s:push(translate_now("terminal_locale", 'crypt_invalid_key')); end; else - s:push(translate_now(computer_locale, 'crypt_unencrypted')); + s:push(translate_now("terminal_locale", 'crypt_unencrypted')); end; end; end; @@ -872,21 +872,21 @@ room { s:push('HARDWARE=FALSE'); s:push(';KEY=KEY.TXT'); else - s:push(translate_now(computer_locale, 'bad_command')); + s:push(translate_now("terminal_locale", 'bad_command')); end; end; ['KEY.TXT'] = function(s, command, args) if command == 'PRINT.COM' then - s:push(translate_now(computer_locale, 'binary_data')); + s:push(translate_now("terminal_locale", 'binary_data')); else - s:push(translate_now(computer_locale, 'bad_command')); + s:push(translate_now("terminal_locale", 'bad_command')); end; end; }, ['SYSTEM'] = { ['CONNECT.EXE'] = function(s, command, args) if command == 'PRINT.COM' then - s:push(translate_now(computer_locale, 'binary_data')); + s:push(translate_now("terminal_locale", 'binary_data')); elseif command == '' then s.status = 'connect'; return true; @@ -894,46 +894,46 @@ room { end; ['FORMAT.COM'] = function(s, command, args) if command == 'PRINT.COM' then - s:push(translate_now(computer_locale, 'binary_data')); + s:push(translate_now("terminal_locale", 'binary_data')); elseif command == '' then if args and args:lower() == 'c:' then s.status = 'format'; return true; elseif args and string.match(args, "^[A-z]:$") == args then - s:push(translate_now(computer_locale, 'format_invalid_device')); + s:push(translate_now("terminal_locale", 'format_invalid_device')); else - s:push(translate_now(computer_locale, 'format_usage')); + s:push(translate_now("terminal_locale", 'format_usage')); end; end; end; ['HELP.COM'] = function(s, command, args) if command == 'PRINT.COM' then - s:push(translate_now(computer_locale, 'binary_data')); + s:push(translate_now("terminal_locale", 'binary_data')); elseif command == '' then - s:push(translate_now(computer_locale, 'help_cd')); - s:push(translate_now(computer_locale, 'help_dir')); - s:push(translate_now(computer_locale, 'help_disk')); - s:push(translate_now(computer_locale, 'help_connect')); - s:push(translate_now(computer_locale, 'help_format')); - s:push(translate_now(computer_locale, 'help_help')); - s:push(translate_now(computer_locale, 'help_print')); - s:push(translate_now(computer_locale, 'help_exit')); - s:push(translate_now(computer_locale, 'help_com_exe')); + s:push(translate_now("terminal_locale", 'help_cd')); + s:push(translate_now("terminal_locale", 'help_dir')); + s:push(translate_now("terminal_locale", 'help_disk')); + s:push(translate_now("terminal_locale", 'help_connect')); + s:push(translate_now("terminal_locale", 'help_format')); + s:push(translate_now("terminal_locale", 'help_help')); + s:push(translate_now("terminal_locale", 'help_print')); + s:push(translate_now("terminal_locale", 'help_exit')); + s:push(translate_now("terminal_locale", 'help_com_exe')); end; end; ['PRINT.COM'] = function(s, command, args) if command == 'PRINT.COM' then - s:push(translate_now(computer_locale, 'binary_data')); + s:push(translate_now("terminal_locale", 'binary_data')); elseif command == '' then if args then local cmd = s:walk_directory(args:upper(), true); if type(cmd) == 'function' then cmd(s, 'PRINT.COM', '') else - s:push(translate_now(computer_locale, 'print_no_file')); + s:push(translate_now("terminal_locale", 'print_no_file')); end; else - s:push(translate_now(computer_locale, 'print_usage')); + s:push(translate_now("terminal_locale", 'print_usage')); end; end; end; @@ -941,9 +941,9 @@ room { ['AUTOEXEC.BAT'] = function(s, command, args) if command == 'PRINT.COM' then s:push('SET PATH=C:\\SYSTEM'); - s:push(translate_now(computer_locale, 'connect_comment')); + s:push(translate_now("terminal_locale", 'connect_comment')); elseif command == '' then - s:push(translate_now(computer_locale, 'bad_command')); + s:push(translate_now("terminal_locale", 'bad_command')); end; end; ['CONFIG.SYS'] = function(s, command, args) @@ -956,21 +956,21 @@ room { s:push('DEVICE=C:\\SYSTEM\\EMM386.EXE'); s:push('DEVICE=C:\\SYSTEM\\TOWER.SYS'); elseif command == '' then - s:push(translate_now(computer_locale, 'bad_command')); + s:push(translate_now("terminal_locale", 'bad_command')); end; end; ['COMMAND.COM'] = function(s, command, args) if command == 'PRINT.COM' then - s:push(translate_now(computer_locale, 'binary_data')); + s:push(translate_now("terminal_locale", 'binary_data')); elseif command == '' then - s:push(translate_now(computer_locale, 'command_already_started')); + s:push(translate_now("terminal_locale", 'command_already_started')); end; end; ['HELLO.TXT'] = function(s, command, args) if command == 'PRINT.COM' then - s:push(translate_now(computer_locale, 'hello_txt')); + s:push(translate_now("terminal_locale", 'hello_txt')); elseif command == '' then - s:push(translate_now(computer_locale, 'bad_command')); + s:push(translate_now("terminal_locale", 'bad_command')); end; end; } @@ -1056,26 +1056,26 @@ room { if type(dir) == 'table' then s.path = path .. '\\'; else - s:push(translate_now(computer_locale, 'cd_invalid_directory', {path=args})); + s:push(translate_now("terminal_locale", 'cd_invalid_directory', {path=args})); end; else - s:push(translate_now(computer_locale, 'cd_usage')); + s:push(translate_now("terminal_locale", 'cd_usage')); end; elseif command == 'ver' then - s:push(translate_now(terminal_locale, 'tower_os_line_2')); + s:push(translate_now("terminal_locale", 'tower_os_line_2')); elseif command == 'exit' then walk('tower_level_4_room_2'); return true; elseif command == 'rm' and args and #args >= 2 and (args == '-rf . /' or args == '-rf /') then - s:push(translate_now(terminal_locale, random_phrase({'unix_line_3', 'unix_line_4'}))); + s:push(translate_now("terminal_locale", random_phrase({'unix_line_3', 'unix_line_4'}))); elseif command == 'sudo' or command == 'su' or command == 'ls' or command == 'rm' then - s:push(translate_now(terminal_locale, random_phrase({'unix_line_1', 'unix_line_2'}))); + s:push(translate_now("terminal_locale", random_phrase({'unix_line_1', 'unix_line_2'}))); elseif command == 'cat' then - s:push(translate_now(terminal_locale, random_phrase({'cat_line_1', 'cat_line_2', 'cat_line_3'}))); + s:push(translate_now("terminal_locale", random_phrase({'cat_line_1', 'cat_line_2', 'cat_line_3'}))); elseif command == 'more' or command == 'less' then - s:push(translate_now(terminal_locale, 'more_line_1')); + s:push(translate_now("terminal_locale", 'more_line_1')); elseif command == 'head' or command == 'tail' then - s:push(translate_now(terminal_locale, random_phrase({'head_line_1', 'head_line_2'}))); + s:push(translate_now("terminal_locale", random_phrase({'head_line_1', 'head_line_2'}))); elseif command == 'echo' then if args then s:push(args); @@ -1094,14 +1094,14 @@ room { if (s.directory_structure[command]) then s.path = command:upper() .. '\\'; else - s:push(translate_now(computer_locale, 'format_invalid_device')); + s:push(translate_now("terminal_locale", 'format_invalid_device')); end; else local cmd = s:walk_directory(command:upper()) if type(cmd) == 'function' then r = cmd(s, '', args); else - s:push(translate_now(computer_locale, 'bad_command')); + s:push(translate_now("terminal_locale", 'bad_command')); end; end; if not r then