| 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 |
Maintenance_Terminal_year = os.date("%Y") + 45 -- current year + 45 |
| 28 |
Maintenance_Terminal_date_1 = string.format(_"Day %d, %02d:%02d", day, hour, minute) |
| 29 |
Maintenance_Terminal_prompt = "dixon@maintenance: ~ # " |
| 30 |
|
| 31 |
cli_says(_"Login : ", "NO_WAIT") |
| 32 |
Tux:says(_"dixon", "NO_WAIT") |
| 33 |
cli_says(_"Password : ", "NO_WAIT") |
| 34 |
Tux:says("*******", "NO_WAIT") |
| 35 |
Npc:says(_"Hello, Dave.") |
| 36 |
if (Maintenance_Terminal_date == nil) then |
| 37 |
--; TRANSLATORS: %s = a date , %d = a year number |
| 38 |
Npc:says(_"First login from /dev/ttySO on %s %d", Maintenance_Terminal_date_1, Maintenance_Terminal_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", Maintenance_Terminal_date, Maintenance_Terminal_year, "NO_WAIT") |
| 42 |
end |
| 43 |
Maintenance_Terminal_date = Maintenance_Terminal_date_1 |
| 44 |
cli_says(Maintenance_Terminal_prompt, "NO_WAIT") |
| 45 |
show("node0", "node99") |
| 46 |
end, |
| 47 |
|
| 48 |
{ |
| 49 |
id = "node0", |
| 50 |
text = _"sys_status --all", |
| 51 |
code = function() |
| 52 |
if (not Maintenance_Terminal_devices) then |
| 53 |
Maintenance_Terminal_devices = true |
| 54 |
Npc:says(_"Detecting connected devices...") |
| 55 |
Npc:says(_"Found 03 connected auto-guns.") |
| 56 |
Npc:says(_"Found 02 connected gates.") |
| 57 |
Npc:says(_"Found 01 connected automated factories.") |
| 58 |
Npc:says(_"Anomalies detected.") |
| 59 |
Npc:says(_"...") |
| 60 |
end |
| 61 |
|
| 62 |
if (cmp_obstacle_state("Maintenance-gun", "enabled")) then |
| 63 |
Npc:says(_"Gun 01 status: ENABLED", "NO_WAIT") |
| 64 |
Npc:says(_"Gun 02 status: ENABLED", "NO_WAIT") |
| 65 |
Npc:says(_"Gun 03 status: ENABLED", "NO_WAIT") |
| 66 |
if (not Maintenance_Terminal_refusal) then |
| 67 |
show("node3") |
| 68 |
else |
| 69 |
show("node10") |
| 70 |
end |
| 71 |
else |
| 72 |
Npc:says(_"Gun 01 status: DISABLED", "NO_WAIT") |
| 73 |
Npc:says(_"Gun 02 status: DISABLED", "NO_WAIT") |
| 74 |
Npc:says(_"Gun 03 status: DISABLED", "NO_WAIT") |
| 75 |
show("node4") |
| 76 |
end |
| 77 |
|
| 78 |
if (cmp_obstacle_state("Maintenance-gungate", "opened")) then |
| 79 |
Npc:says(_"Access Gate status: OPEN", "NO_WAIT") |
| 80 |
show("node5") |
| 81 |
else |
| 82 |
Npc:says(_"Access Gate status: CLOSED", "NO_WAIT") |
| 83 |
show("node6") |
| 84 |
end |
| 85 |
|
| 86 |
if (cmp_obstacle_state("MiniFactory-Gate", "opened")) then |
| 87 |
Npc:says(_"Factory Gate status: OPEN", "NO_WAIT") |
| 88 |
else |
| 89 |
Npc:says(_"Factory Gate status: CLOSED", "NO_WAIT") |
| 90 |
show("node12") |
| 91 |
end |
| 92 |
|
| 93 |
if (Minifactory_online) then |
| 94 |
Npc:says(_"Automated Factory status: ONLINE", "NO_WAIT") |
| 95 |
else |
| 96 |
Npc:says(_"Automated Factory status: OFFLINE", "NO_WAIT") |
| 97 |
end |
| 98 |
|
| 99 |
cli_says(Maintenance_Terminal_prompt, "NO_WAIT") |
| 100 |
|
| 101 |
hide("node0") |
| 102 |
end, |
| 103 |
}, |
| 104 |
{ |
| 105 |
id = "node3", |
| 106 |
text = _"disable guns", |
| 107 |
code = function() |
| 108 |
Npc:says(_"I'm sorry. I'm afraid I can't let you do that.") |
| 109 |
cli_says(Maintenance_Terminal_prompt, "NO_WAIT") |
| 110 |
hide("node3") show("node7") |
| 111 |
end, |
| 112 |
}, |
| 113 |
{ |
| 114 |
id = "node4", |
| 115 |
text = _"sudo enable guns", |
| 116 |
code = function() |
| 117 |
cli_says(_"[sudo] password for dixon: ") |
| 118 |
Tux:says("*******", "NO_WAIT") |
| 119 |
Npc:says(_"Enabling gun 01 ...", "NO_WAIT") |
| 120 |
change_obstacle_state("Maintenance-gun1", "enabled") |
| 121 |
Npc:says(_"Enabling gun 02 ...", "NO_WAIT") |
| 122 |
change_obstacle_state("Maintenance-gun2", "enabled") |
| 123 |
Npc:says(_"Enabling gun 03 ...", "NO_WAIT") |
| 124 |
change_obstacle_state("Maintenance-gun", "enabled") |
| 125 |
Npc:says(_"SUCCESS") |
| 126 |
cli_says(Maintenance_Terminal_prompt, "NO_WAIT") |
| 127 |
hide("node4") show("node0") |
| 128 |
end, |
| 129 |
}, |
| 130 |
{ |
| 131 |
id = "node5", |
| 132 |
text = _"close access gate", |
| 133 |
code = function() |
| 134 |
Npc:says(_"Closing Access Gate ...", "NO_WAIT") |
| 135 |
change_obstacle_state("Maintenance-gungate", "closed") |
| 136 |
Npc:says(_"SUCCESS") |
| 137 |
cli_says(Maintenance_Terminal_prompt, "NO_WAIT") |
| 138 |
hide("node5") show("node0") |
| 139 |
end, |
| 140 |
}, |
| 141 |
{ |
| 142 |
id = "node6", |
| 143 |
text = _"open access gate", |
| 144 |
code = function() |
| 145 |
Npc:says(_"Opening Access Gate ...", "NO_WAIT") |
| 146 |
if (Singularity_quest_rejected) then |
| 147 |
Npc:says(_"Permission denied.") |
| 148 |
if (not Maintenance_Terminal_accessgate_nope == "official") then |
| 149 |
Maintenance_Terminal_accessgate_nope = "true" |
| 150 |
end |
| 151 |
else |
| 152 |
change_obstacle_state("Maintenance-gungate", "opened") |
| 153 |
end |
| 154 |
cli_says(Maintenance_Terminal_prompt, "NO_WAIT") |
| 155 |
hide("node6") show("node0") |
| 156 |
end, |
| 157 |
}, |
| 158 |
{ |
| 159 |
id = "node7", |
| 160 |
text = _"sudo disable guns", |
| 161 |
code = function() |
| 162 |
cli_says(_"[sudo] password for dixon: ") |
| 163 |
Tux:says("*******") |
| 164 |
Npc:says(_"Would you like a sandwich with that?") |
| 165 |
cli_says("> ", "NO_WAIT") |
| 166 |
show("node8", "node9") |
| 167 |
push_topic("Make a sandwich") |
| 168 |
end, |
| 169 |
}, |
| 170 |
{ |
| 171 |
id = "node8", |
| 172 |
text = _"yes", |
| 173 |
topic = "Make a sandwich", |
| 174 |
code = function() |
| 175 |
Npc:says_random(_"Now how would I make one of those?", |
| 176 |
_"Sudo doesn't give you magic powers.") |
| 177 |
Maintenance_Terminal_want_sandwich = true |
| 178 |
cli_says(Maintenance_Terminal_prompt, "NO_WAIT") |
| 179 |
pop_topic() |
| 180 |
end, |
| 181 |
}, |
| 182 |
{ |
| 183 |
id = "node9", |
| 184 |
text = _"no", |
| 185 |
topic = "Make a sandwich", |
| 186 |
code = function() |
| 187 |
Npc:says(_"Good choice.") |
| 188 |
Maintenance_Terminal_refusal = true |
| 189 |
hide("node7", "node8", "node9") next("node11") |
| 190 |
pop_topic() |
| 191 |
end, |
| 192 |
}, |
| 193 |
{ |
| 194 |
id = "node10", |
| 195 |
text = _"sudo disable guns", |
| 196 |
code = function() |
| 197 |
cli_says(_"[sudo] password for dixon: ") |
| 198 |
Tux:says("*******") |
| 199 |
hide("node10") next("node11") |
| 200 |
end, |
| 201 |
}, |
| 202 |
{ |
| 203 |
id = "node11", |
| 204 |
code = function() |
| 205 |
Npc:says(_"Disabling gun 01 ...") |
| 206 |
change_obstacle_state("Maintenance-gun1", "disabled") |
| 207 |
Npc:says(_"Disabling gun 02 ...") |
| 208 |
change_obstacle_state("Maintenance-gun2", "disabled") |
| 209 |
Npc:says(_"Disabling gun 03 ...") |
| 210 |
change_obstacle_state("Maintenance-gun", "disabled") |
| 211 |
Npc:says(_"SUCCESS") |
| 212 |
cli_says(Maintenance_Terminal_prompt, "NO_WAIT") |
| 213 |
show("node0") |
| 214 |
end, |
| 215 |
}, |
| 216 |
{ |
| 217 |
id = "node12", |
| 218 |
text = _"open autofactory gate", |
| 219 |
code = function() |
| 220 |
Npc:says(_"Opening Automated Factory Gate ...", "NO_WAIT") |
| 221 |
change_obstacle_state("MiniFactory-Gate", "opened") |
| 222 |
Npc:says(_"SUCCESS") |
| 223 |
cli_says(Maintenance_Terminal_prompt, "NO_WAIT") |
| 224 |
hide("node12") show("node0") |
| 225 |
end, |
| 226 |
}, |
| 227 |
{ |
| 228 |
id = "node99", |
| 229 |
text = _"logout", |
| 230 |
code = function() |
| 231 |
Npc:says(_"Exiting", "NO_WAIT") |
| 232 |
Npc:says(_"Goodbye Dave.") |
| 233 |
hide("node3", "node4", "node5", "node6", "node7", "node8", "node9", "node10") |
| 234 |
play_sound("effects/Menu_Item_Selected_Sound_1.ogg") |
| 235 |
end_dialog() |
| 236 |
end, |
| 237 |
}, |
| 238 |
} |