| 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 |
DSB_PowerControlGate1_year = os.date("%Y") + 45 -- current year + 45 |
| 28 |
DSB_PowerControlGate1_date_1 = string.format(_"Day %d, %02d:%02d", day, hour, minute) |
| 29 |
DSB_PowerControlGate1_prompt = "[email protected]: ~ #" |
| 30 |
|
| 31 |
cli_says(_"Login : ", "NO_WAIT") |
| 32 |
Tux:says(_"admin", "NO_WAIT") |
| 33 |
cli_says(_"Password : ", "NO_WAIT") |
| 34 |
Tux:says(_"*******", "NO_WAIT") |
| 35 |
Npc:says(_"[b]Login failed. Entering as Guest[/b]") |
| 36 |
Npc:says(" ", "NO_WAIT") |
| 37 |
Npc:says(_"Welcome to [b]Power Control Gate 1 Terminal[/b]!", "NO_WAIT") |
| 38 |
Npc:says(" ", "NO_WAIT") |
| 39 |
if (DSB_PowerControlGate1_date == nil) then |
| 40 |
--; TRANSLATORS: %s = a date , %d = a year number |
| 41 |
Npc:says(_"First login from /dev/ttySO on %s %d", DSB_PowerControlGate1_date_1, DSB_PowerControlGate1_year, "NO_WAIT") |
| 42 |
else |
| 43 |
--; TRANSLATORS: %s = a date , %d = a year number |
| 44 |
Npc:says(_"Last login from /dev/ttyS0 on %s %d", DSB_PowerControlGate1_date, DSB_PowerControlGate1_year, "NO_WAIT") |
| 45 |
end |
| 46 |
DSB_PowerControlGate1_date = DSB_PowerControlGate1_date_1 |
| 47 |
|
| 48 |
cli_says(DSB_PowerControlGate1_prompt, "NO_WAIT") |
| 49 |
if (cmp_obstacle_state("DSB-PCGate1", "closed")) then |
| 50 |
show("node0") |
| 51 |
elseif (cmp_obstacle_state("DSB-PCGate1", "opened")) then |
| 52 |
show("node10") |
| 53 |
else |
| 54 |
Npc:says(_"GAME BUG. PLEASE REPORT.") |
| 55 |
end |
| 56 |
show("node99") |
| 57 |
end, |
| 58 |
|
| 59 |
{ |
| 60 |
id = "node0", |
| 61 |
text = _"open gate", |
| 62 |
code = function() |
| 63 |
--if (not dsb_pc_access) then |
| 64 |
Npc:says(_"Gate status: CLOSED", "NO_WAIT") |
| 65 |
Npc:says(_"Security Access to this area denied.") |
| 66 |
Npc:says(_"Contact personnel in the Machine Deck Control Room if you believe this to be an error.") |
| 67 |
--else |
| 68 |
-- Npc:says(_"Gate status: CLOSED", "NO_WAIT") |
| 69 |
-- Npc:says(_"Access granted. Opening gate ...") |
| 70 |
--- Npc:says(_"Gate status: OPEN") |
| 71 |
-- change_obstacle_state("DSB-PCGate1", "opened") |
| 72 |
-- hide("node0") show("node10") |
| 73 |
--end |
| 74 |
cli_says(DSB_PowerControlGate1_prompt, "NO_WAIT") |
| 75 |
end, |
| 76 |
}, |
| 77 |
{ |
| 78 |
id = "node10", |
| 79 |
text = _"close gate", |
| 80 |
code = function() |
| 81 |
Npc:says(_"Gate status: OPEN", "NO_WAIT") |
| 82 |
Npc:says(_"Access granted. Closing gate ...") |
| 83 |
Npc:says(_"Gate status: CLOSED") |
| 84 |
change_obstacle_state("DSB-PCGate1", "closed") |
| 85 |
cli_says(DSB_PowerControlGate1_prompt, "NO_WAIT") |
| 86 |
hide("node10") show("node0") |
| 87 |
end, |
| 88 |
}, |
| 89 |
{ |
| 90 |
id = "node99", |
| 91 |
text = _"logout", |
| 92 |
code = function() |
| 93 |
Npc:says(_"Exiting", "NO_WAIT") |
| 94 |
Npc:says_random(_"Have a nice day.", |
| 95 |
_"Have a wonderful day.", |
| 96 |
_"We hope your day will be most productive.") |
| 97 |
play_sound("effects/Menu_Item_Selected_Sound_1.ogg") |
| 98 |
end_dialog() |
| 99 |
end, |
| 100 |
}, |
| 101 |
} |