Import The Server Room by Daniel Bartholomew
[the-server-room.git] / the-server-room.inf
1 !% -SD
2 !=========================================================================
3 ! Copyright (C) 2008 Daniel Bartholomew
4 !
5 ! This program is free software: you can redistribute it and/or modify
6 ! it under the terms of the GNU General Public License as published by
7 ! the Free Software Foundation, either version 3 of the License, or
8 ! (at your option) any later version.
9 !
10 ! This program is distributed in the hope that it will be useful,
11 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ! GNU General Public License for more details.
14 !
15 ! You should have received a copy of the GNU General Public License
16 ! along with this program. If not, see
17 ! <https://www.gnu.org/licenses/>.
18 !=========================================================================
19 Constant Story "The Server Room";
20 Constant Headline
21     "^An Interactive Fiction by Daniel Bartholomew.^";
22 Release 1; Serial "080625"; !for keeping track of public releases
23
24 Constant MAX_SCORE = 6;
25
26 Include "Parser";
27 Include "VerbLib";
28
29 global openedbackpack = 1;
30 global openedtray = 1;
31 global takencd = 1;
32 global beeping = 1;
33
34 !=========================================================================
35 ! The Game Objects
36
37 Object break_room "Break Room"
38     with
39         description "Your standard break room. A fridge, and a long
40             counter take up one wall. East is the outside world and west
41             is the hallway to the server room.",
42         w_to hallway,
43         e_to "You take one look outside and think better of it. The
44             daystar is too bright and terrible to face today. Besides, you
45             have work to do.",
46     has light;
47
48 Object fridge "refrigerator" break_room
49     with
50         description "Your standard refrigerator.",
51         name 'fridge' 'refrigerator',
52     has container openable scenery;
53
54 Object counter "long counter" break_room
55     with
56         description "A long counter. You can't quite determine the color,
57             it's somewhere between green and brown. On the counter is a
58             microwave.",
59         name 'counter',
60     has static supporter scenery;
61
62 Object microwave "microwave" counter
63     with
64         description "Your standard microwave.",
65         name 'microwave' 'micro',
66     has container openable scenery;
67
68 Object table "Table" break_room
69     with
70         description "It's a table. Were you expecting something else?",
71         name 'table',
72     before [;
73         Take: "Let me spell it out for you: it is a T A B L E and you are
74                 NOT Superman.";
75     ],
76     has supporter;
77
78 Object backpack "backpack" table
79     with
80         description "Your backpack.",
81         name 'pack' 'back' 'bag' 'backpack', article "your",
82     before [;
83         Open:
84             if (openedbackpack == 1) {
85                 score = score + 2;
86                 openedbackpack = 2;
87             }
88     ],
89     has clothing container openable;
90
91 Object disc "Ubuntu CD" backpack
92     with
93         description "An automatic recovery CD, guaranteed to fix almost
94             any server.^^Ok, it's just an install CD that auto-installs
95             Ubuntu, but hey, if it works, it works.",
96         name 'disk' 'disc' 'Ubuntu' 'cd',
97     after [;
98         Take:
99             if (takencd == 1) {
100                 score = score + 2;
101                 takencd = 2;
102                 print_ret "You pick up the Ubuntu CD.^";
103             }
104     ],
105     has ;
106
107 Object hallway "Hallway"
108     with
109         description "Bereft of features, adornment or even adequate
110             lighting, this hallway is as plain as they come. Doors lead
111             east back to the break room, north to the server room, or west
112             to the restrooms.",
113         e_to break_room,
114         n_to server_room,
115         w_to "When nature calls, you'll know about it, but right now, it
116                 isn't calling.",
117         before [;
118             Go:
119                 if (noun == n_obj) {
120                     StartDaemon(server_room);
121                     print "^^You use your key card to open the server room
122                         door and step into your world.^";
123                 }
124         ],
125     has    light;
126
127 Object server_room "Server Room"
128     with
129         description "The fans, the lights, the chill . . . yep, it's a
130             server room. Full of servers from a dozen different
131             manufacturers, each with their own quirks.^^Your attention is
132             immediately drawn to a server 2/3 of the way up rack 7. The
133             little indicator light is blinking red, and it is beeping.",
134         s_to hallway,
135         daemon [;
136             if (location ~= server_room) return;
137             beeping = random(7);
138             switch (beeping) {
139                 1: "^The beeping is driving you crazy.";
140                 2: "^It's hard to think, with all of the beeping.";
141                 3: "^The monotony of the beeping is maddening.";
142                 4: "^You can't stand the beeping.";
143                 5: "^The beeping reminds you of your alarm clock.";
144                 6: "^beep . . . beep . . . beep . . . beep . . . beep
145                      . . . beep . . .";
146                 7: "^If you don't stop the beeping soon, you'll loose what
147                     little hair you have left.";
148             }
149         ],
150     has    light;
151
152 Object server "server" server_room
153     with
154         description "The indicator light on this ancient server is
155             blinking orange. The rest the front is featureless except for
156             the CD tray. The beeping seems to emanate from somewhere
157             inside the server.",
158         name 'server' 'machine' 'computer' 'ancient' 'old',
159     has scenery;
160
161 Object tray "tray" server_room
162     with
163         description "It's a CD tray. Just like every other CD tray.",
164         name 'cd' 'tray',
165     before [;
166         Open:
167             if (openedtray == 1) {
168                 score = score + 2;
169                 openedtray = 2;
170             }
171     ],
172     after [;
173         Open:
174             print_ret "You press the button and the CD tray pops out.";
175         Close:
176             if (disc in self) {
177                 deadflag = 5;
178                 print_ret "^With the CD in the tray, you quickly reboot
179                     the server.^^After the bios posts, your disc starts
180                     doing its thing and before you know it the server is
181                     happily running Ubuntu, and even more than that, the
182                     beeping has stopped. Yay!";
183             }
184     ],
185     has container openable scenery;
186
187 !=========================================================================
188 ! Entry point routines
189
190 [ Initialise;
191     location = break_room;
192     "^^^^It's Saturday, a nice one at that, and you've been called in to
193         fix a server that's on the blink. Again.^^You've had it. This
194         server is going to run Linux from this day forward! The process
195         will be easy - just put the disc into the server and away we go.
196         Now where is that Ubuntu CD?^";
197 ];
198
199 [ Deathmessage;
200     if (deadflag == 5) print "You have won";
201 ];
202
203 !=========================================================================
204 ! Standard and Extended Grammar
205
206 Include "Grammar";
207
208 !=========================================================================