| 1 |
--------------------------------------------------------------------- |
| 2 |
-- This file is part of Freedroid |
| 3 |
-- |
| 4 |
-- Freedroid is free software; you can redistribute it and/or modify |
| 5 |
-- it under the terms of the GNU General Public License as published by |
| 6 |
-- the Free Software Foundation; either version 2 of the License, or |
| 7 |
-- (at your option) any later version. |
| 8 |
-- |
| 9 |
-- Freedroid is distributed in the hope that it will be useful, |
| 10 |
-- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
-- GNU General Public License for more details. |
| 13 |
-- |
| 14 |
-- You should have received a copy of the GNU General Public License |
| 15 |
-- along with Freedroid; see the file COPYING. If not, write to the |
| 16 |
-- Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 17 |
-- MA 02111-1307 USA |
| 18 |
---------------------------------------------------------------------- |
| 19 |
|
| 20 |
local Npc = FDrpg.get_npc() |
| 21 |
local Tux = FDrpg.get_tux() |
| 22 |
|
| 23 |
return { |
| 24 |
EveryTime = function() |
| 25 |
play_sound("effects/Menu_Item_Deselected_Sound_0.ogg") |
| 26 |
local day, hour, minute = game_date() |
| 27 |
RRGateTerminal_year = os.date("%Y") + 45 -- current year + 45 |
| 28 |
RRGateTerminal_date_1 = string.format(_"Day %d, %02d:%02d", day, hour, minute) |
| 29 |
RRGateTerminal_prompt = "[email protected]: ~ #" |
| 30 |
|
| 31 |
cli_says(_"Login : ", "NO_WAIT") |
| 32 |
--; TRANSLATORS: username, maybe this should stay in lowercase letters? |
| 33 |
Tux:says(_"guest", "NO_WAIT") |
| 34 |
cli_says(_"Entering as guest", "NO_WAIT") |
| 35 |
Npc:says("", "NO_WAIT") |
| 36 |
if (RRGateTerminal_date == nil) then |
| 37 |
--; TRANSLATORS: %s = a date , %d = a year number |
| 38 |
Npc:says(_"First login from /dev/ttySO on %s %d", RRGateTerminal_date_1, RRGateTerminal_year, "NO_WAIT") |
| 39 |
else |
| 40 |
--; TRANSLATORS: %s = a date , %d = a year number |
| 41 |
Npc:says(_"Last login from /dev/ttyS0 on %s %d", RRGateTerminal_date, RRGateTerminal_year, "NO_WAIT") |
| 42 |
end |
| 43 |
RRGateTerminal_date = RRGateTerminal_date_1 |
| 44 |
|
| 45 |
-- Too convenient? |
| 46 |
if (cmp_obstacle_state("Act2CityGate", "closed")) then |
| 47 |
Npc:says(_"City gate status: CLOSED", "NO_WAIT") |
| 48 |
show("node0") hide("node10") |
| 49 |
elseif (cmp_obstacle_state("Act2CityGate", "opened")) then |
| 50 |
Npc:says(_"City gate status: OPEN", "NO_WAIT") |
| 51 |
show("node10") hide("node0") |
| 52 |
else |
| 53 |
Npc:says("GAME BUG. PLEASE REPORT, RRGATE_TERMINAL EveryTime LuaCode") |
| 54 |
end |
| 55 |
cli_says(RRGateTerminal_prompt, "NO_WAIT") |
| 56 |
show("node99") |
| 57 |
end, |
| 58 |
|
| 59 |
{ |
| 60 |
id = "node0", |
| 61 |
--; TRANSLATORS: command, use lowercase here |
| 62 |
text = _"open gate", |
| 63 |
echo_text = false, |
| 64 |
code = function() |
| 65 |
--; TRANSLATORS: command, use lowercase here |
| 66 |
Tux:says(_"open gate", "NO_WAIT") |
| 67 |
Npc:says(_"Access granted. Opening gate ...") |
| 68 |
Npc:says(_"Gate status: OPEN") |
| 69 |
change_obstacle_state("Act2CityGate", "opened") |
| 70 |
cli_says(RRGateTerminal_prompt, "NO_WAIT") |
| 71 |
hide("node0") show("node10") |
| 72 |
end, |
| 73 |
}, |
| 74 |
{ |
| 75 |
id = "node10", |
| 76 |
--; TRANSLATORS: command, use lowercase here |
| 77 |
text = _"close gate", |
| 78 |
echo_text = false, |
| 79 |
code = function() |
| 80 |
--; TRANSLATORS: command, use lowercase here |
| 81 |
Tux:says(_"close gate", "NO_WAIT") |
| 82 |
Npc:says(_"Access granted. Closing gate ...") |
| 83 |
Npc:says(_"Gate status: CLOSED") |
| 84 |
change_obstacle_state("Act2CityGate", "closed") |
| 85 |
cli_says(RRGateTerminal_prompt, "NO_WAIT") |
| 86 |
hide("node10") show("node0") |
| 87 |
end, |
| 88 |
}, |
| 89 |
{ |
| 90 |
id = "node99", |
| 91 |
--; TRANSLATORS: command, use lowercase here |
| 92 |
text = _"logout", |
| 93 |
echo_text = false, |
| 94 |
code = function() |
| 95 |
--; TRANSLATORS: command, use lowercase here |
| 96 |
Tux:says(_"logout", "NO_WAIT") |
| 97 |
Npc:says(_"Exiting...") |
| 98 |
play_sound("effects/Menu_Item_Selected_Sound_1.ogg") |
| 99 |
end_dialog() |
| 100 |
end, |
| 101 |
}, |
| 102 |
} |