Debian Codegraph @

data/storyline/act1/dialogs/TutorialTerminal.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 EveryTime = function()
25 play_sound("effects/Menu_Item_Deselected_Sound_0.ogg")
26 local day, hour, minute = game_date()
27 TutorialTerminal_year = os.date("%Y") + 45 -- current year + 45
28 TutorialTerminal_date_1 = string.format(_"Day %d, %02d:%02d", day, hour, minute)
29 TutorialTerminal_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 (TutorialTerminal_date == nil) then
37 --; TRANSLATORS: %s = a date , %d = a year number
38 Npc:says(_"First login from /dev/ttySO on %s %d", TutorialTerminal_date_1, TutorialTerminal_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", TutorialTerminal_date, TutorialTerminal_year, "NO_WAIT")
42 end
43 TutorialTerminal_date = TutorialTerminal_date_1
44
45 if (cmp_obstacle_state("TutorialDoor", "closed")) then
46 Npc:says(_"Gate status: CLOSED", "NO_WAIT")
47 show("node0")
48 elseif (cmp_obstacle_state("TutorialDoor", "opened")) then
49 Npc:says(_"Gate status: OPEN", "NO_WAIT")
50 show("node10")
51 else
52 Npc:says("GAME BUG. PLEASE REPORT, TUTORIAL-TERMINAL EveryTime LuaCode")
53 end
54 cli_says(TutorialTerminal_prompt, "NO_WAIT")
55 show("node99")
56 end,
57
58 {
59 id = "node0",
60 --; TRANSLATORS: command, use lowercase here
61 text = _"open gate",
62 echo_text = false,
63 code = function()
64 --; TRANSLATORS: command, use lowercase here
65 Tux:says(_"open gate", "NO_WAIT")
66 Npc:says(_"Access granted. Opening gate ...")
67 Npc:says(_"Gate status: OPEN")
68 change_obstacle_state("TutorialDoor", "opened")
69 cli_says(TutorialTerminal_prompt, "NO_WAIT")
70 hide("node0") show("node10")
71 end,
72 },
73 {
74 id = "node10",
75 --; TRANSLATORS: command, use lowercase here
76 text = _"close gate",
77 echo_text = false,
78 code = function()
79 --; TRANSLATORS: command, use lowercase here
80 Tux:says(_"close gate", "NO_WAIT")
81 Npc:says(_"Access granted. Closing gate ...")
82 Npc:says(_"Gate status: CLOSED")
83 change_obstacle_state("TutorialDoor", "closed")
84 cli_says(TutorialTerminal_prompt, "NO_WAIT")
85 hide("node10") show("node0")
86 end,
87 },
88 {
89 id = "node99",
90 --; TRANSLATORS: command, use lowercase here
91 text = _"logout",
92 echo_text = false,
93 code = function()
94 --; TRANSLATORS: command, use lowercase here
95 Tux:says(_"logout", "NO_WAIT")
96 Npc:says(_"Exiting...")
97 play_sound("effects/Menu_Item_Selected_Sound_1.ogg")
98 if (cmp_obstacle_state("TutorialDoor", "opened")) and
99 (TutorialTom_start_chat == nil) then
100 TutorialTom_start_chat = true
101 start_chat("TutorialTom")
102 end
103 end_dialog()
104 end,
105 },
106 }