Debian Codegraph @

data/storyline/act1/dialogs/SACD.lua

raw
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 FirstTime = function()
25 show("node1", "node3")
26 end,
27
28 EveryTime = function()
29 local day, hour, minute = game_date()
30 SACD_year = os.date("%Y") + 45 -- current year + 45
31 SACD_date_1 = string.format(_"Day %d, %02d:%02d", day, hour, minute)
32 if (not SACD_login) then
33 Tux:update_quest("Tania's Escape", _"I have found the Secret Area Control Datacenter.")
34 Tux:add_xp(1000)
35 SACD_login = true
36 end
37 cli_says(_"Login : ", "NO_WAIT")
38 Tux:says(_"admin", "NO_WAIT")
39 cli_says(_" Password : ", "NO_WAIT")
40 Tux:says(_"*******", "NO_WAIT")
41 if (SACD_date == nil) then
42 --; TRANSLATORS: %s = a date %d = a year
43 Npc:says(_"First login from /dev/ttySO on %s %d", SACD_date_1, SACD_year, "NO_WAIT")
44 else
45 --; TRANSLATORS: %s = a date %d = a year
46 Npc:says(_"Last login from /dev/ttyS0 on %s %d", SACD_date, SACD_year, "NO_WAIT")
47 end
48 SACD_date = SACD_date_1
49 cli_says(_"admin@sadefence: ~ #", "NO_WAIT")
50 hide("node2") show("node99")
51 end,
52
53 {
54 id = "node1",
55 text = _"/usr/bin/guns --disable",
56 code = function()
57 Npc:says(_"Disabling guns...")
58 Npc:says(_"Connecting to peripheral controller...")
59 Npc:says(_"Guns disabled.")
60 SACD_gunsoff = true
61 change_obstacle_state("SADDGun1", "disabled")
62 change_obstacle_state("SADDGun2", "disabled")
63 cli_says(_"admin@sadefence: ~ #", "NO_WAIT")
64 hide("node1") show("node2")
65 end,
66 },
67 {
68 id = "node2",
69 text = _"/usr/bin/guns --enable",
70 code = function()
71 Npc:says(_"Enabling guns...")
72 Npc:says(_"Connecting to peripheral controller...")
73 Npc:says(_"ERROR: Guns cannot be enabled.")
74 --; TRANSLATORS: use lowercase for "admin"
75 cli_says(_"admin@sadefence: ~ #", "NO_WAIT")
76 end,
77 },
78 {
79 id = "node3",
80 text = _"/usr/bin/hermodoors --open",
81 code = function()
82 Npc:says(_"Opening doors...")
83 Npc:says(_"Connecting to peripheral controller...")
84 change_obstacle_state("SACD-North-1", "opened")
85 change_obstacle_state("SACD-North-2", "opened")
86 change_obstacle_state("SACD-North-3", "opened")
87 change_obstacle_state("SA-Main-EastN", "opened")
88 change_obstacle_state("SA-Main-EastS", "opened")
89 change_obstacle_state("SA-Main-WestN", "opened")
90 change_obstacle_state("SA-Main-WestS", "opened")
91 change_obstacle_state("SA-Main-Enter", "opened")
92 Npc:says(_"ERROR: An error occurred while opening some doors.")
93 Npc:says(_"Please enter unlock security override password:")
94 Tux:says(_"CTRL+C")
95 Npc:says(_"Invalid password. Entering lockdown mode.")
96 Npc:says(_"ERROR: Lockdown mode encountered an error.", "NO_WAIT")
97 Npc:says(_"ERROR: error encountered an error.", "NO_WAIT")
98 if (bot_exists("SADD")) then
99 Npc:says(_"ERROR: SADD droids now set to search-and-destroy mode.")
100 SADD:set_faction("ms")
101 SADD:set_name("SADD - Exterminate Mode")
102 SADD:set_destination("SADD-MoveTarget")
103 end
104 cli_says(_"admin@sadefence: ~ #", "NO_WAIT")
105 hide("node3")
106 end,
107 },
108 {
109 id = "node99",
110 text = _"logout",
111 code = function()
112 end_dialog()
113 end,
114 },
115 }