a93486ff401edf47f6a224838861018d70e7093b
[the-server-room.git] / the-server-room.inf
1 !% -SD
2 !=========================================================================
3 ! Copyright (C) 2019 Jason Self <j@jxself.org>
4 !
5 ! This program is free software: you can redistribute it and/or modify
6 ! it under the terms of the GNU Affero General Public License as
7 ! published by the Free Software Foundation, either version 3 of the
8 ! License, or (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 Affero General Public License for more details.
14 !
15 ! You should have received a copy of the GNU Affero General Public
16 ! License along with this program. If not, see
17 ! <https://www.gnu.org/licenses/>.
18 !
19 !This file incorporates work covered by the following copyright and
20 !permission notice:
21 !
22 ! Copyright (C) 2008 Daniel Bartholomew
23 !
24 ! This program is free software: you can redistribute it and/or modify
25 ! it under the terms of the GNU General Public License as published by
26 ! the Free Software Foundation, either version 3 of the License, or
27 ! (at your option) any later version.
28 !
29 ! This program is distributed in the hope that it will be useful,
30 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
31 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 ! GNU General Public License for more details.
33 !
34 ! You should have received a copy of the GNU General Public License
35 ! along with this program. If not, see
36 ! <https://www.gnu.org/licenses/>.
37 !=========================================================================
38 Constant Story "The Server Room";
39 Constant Headline "^An Interactive Fiction by Daniel Bartholomew.^";
40 Release 1;
41 Serial "190908";
42 Constant MAX_SCORE = 6;
43 Include "parser";
44 Include "verblib";
45 Global beeping = 1;
46 !=========================================================================
47 ! The Game Objects
48
49 Object  break_room "Break Room"
50   with  description
51             "This break room is a calm, quiet and peaceful for people
52             to unwind and eat. Well kept and organized, the area is
53             clean and inviting. A large television is mounted to one
54             of the walls, next to a refrigerator. Even though no
55             one's around the smell of a pleasant coffee blend still
56             hangs in the air. A cool-looking counter and white couch
57             take up another wall. The remaining walls have posters of
58             various sports teams of the previous four years. East is
59             the outside world and west is the hallway to the server
60             room.",
61         w_to hallway,
62         e_to
63             "You take one look outside and think better of it. The
64             daystar is too bright and terrible to face today. Besides,
65             you have work to do.",
66   has   light;
67
68 Object  tv "television" break_room
69   with  description
70             "It looks like a cheap, generic flat screen television
71             with an edge-to-edge matte screen. You see no buttons on
72             it. There should be a remote control somewhere.",
73         name 'tv' 'television' 'telly',
74   has   container openable scenery;
75
76 Object  fridge "refrigerator" break_room
77   with  description
78             "This refrigerator makes a statement with a sleek, modern
79             and minimal stainless steel design. Featuring large doors
80             it seems quite an impressive refrigerator that can hold a
81             lot.",
82         name 'fridge' 'refrigerator',
83   has   container openable scenery;
84
85 Object  counter "long counter" break_room
86   with  description
87             "It's a beautiful, stylish, and high-quality solid wood
88             counter that runs the length of the wall. You can't quite
89             determine the color of the sleek countertop, it's
90             somewhere between green and brown. The design on the
91             countertop consists of geometric patterns. It seems a
92             sturdy, durable, and solid counter.",
93         name 'counter',
94   has   static supporter scenery;
95
96 Object  microwave "microwave" counter
97   with  description
98             "A combination of silver and black, this microwave looks
99             like a real workhorse. It's compact, quiet, and works
100             great.",
101         name 'microwave' 'micro',
102   has   container openable;
103
104 Object  table "table" break_room
105   with  description "It's a table. Were you expecting something else?",
106         name 'table',
107         before [;
108           Take:
109             "Let me spell it out for you: it is a T A B L E and you
110             are NOT Superman.";
111         ],
112   has   supporter;
113
114 Object  backpack "backpack" table
115   with  description
116             "This backpack looks like a modern art piece that was
117             made using brown and light blue-green watercolors. A black
118             line was traced around to make the stitching lines.
119             Well-worn and quite suitable for travel, it looks like it
120             could carry a lot of belongings.",
121         name 'pack' 'back' 'bag' 'backpack',
122         article "your",
123         before [;
124           Open:
125             if (backpack hasnt visited) {
126                 score = score + 2;
127                 give backpack visited;
128             }
129         ],
130   has   clothing container openable;
131
132 Object  disc "Trisquel CD" backpack
133   with  description
134             "An automatic recovery CD, guaranteed to fix almost any
135             server.^^Ok, it's just an install CD that auto-installs
136             Trisquel, but hey, if it works, it works.",
137         name 'disk' 'disc' 'Trisquel' 'cd',
138         after [;
139           Take:
140             if (disc hasnt visited) {
141                 score = score + 2;
142                 give disc visited;
143             }
144         ],
145   has   ;
146
147 Object  hallway "Hallway"
148   with  description
149             "Bereft of features, adornment or even adequate lighting,
150             this hallway is as plain as they come. Doors lead east
151             back to the break room, north to the server room, or
152             west to the restrooms.",
153         e_to break_room,
154         n_to
155             "You use your key card to open the server room door but
156             instead of a beep of approval and an unlocked door you
157             get a buzz of denial and the door remains locked. Plus:
158             Through the window in the door you can see someone moving
159             around inside but there shouldn't be anyone else here
160             today.",
161         w_to restroom,
162   has   light;
163
164 Object  restroom "Restroom"
165   with  description
166             "This average-sized, square restroom has a sink set into a
167             resin counter. The floor is tiled, the ceiling has
168             removable tiles, and the walls are painted with a
169             wallpapered dado. Light is provided by ceiling lights. The
170             room is done in colors that remind you of the sky and
171             overall looks very eclectic.",
172         e_to hallway,
173   has   light;
174
175 Object  server_room "Server Room"
176   with  description
177             "The fans, the lights, the chill . . . yep, it's a server
178             room. Full of servers from a dozen different
179             manufacturers, each with their own quirks.^^Your
180             attention is immediately drawn to a server 2/3 of the way
181             up rack 7. The little indicator light is blinking red, and
182             it is beeping.",
183         s_to hallway,
184         each_turn [;
185             beeping = random(7);
186             switch (beeping) {
187               1:
188                 "^The beeping is driving you crazy.";
189               2:
190                 "^It's hard to think, with all of the beeping.";
191               3:
192                 "^The monotony of the beeping is maddening.";
193               4:
194                 "^You can't stand the beeping.";
195               5:
196                 "^The beeping reminds you of your alarm clock.";
197               6:
198                 "^beep . . . beep . . . beep . . . beep . . . beep
199                 . . . beep . . .";
200               7:
201                 "^If you don't stop the beeping soon, you'll loose
202                 what little hair you have left.";
203             }
204         ],
205   has   light;
206
207 Object  server "server" server_room
208   with  description
209             "The indicator light on this ancient server is blinking
210             orange. The rest the front is featureless except for the
211             CD tray. The beeping seems to emanate from somewhere
212             inside the server.",
213         name 'server' 'machine' 'computer' 'ancient' 'old',
214   has   scenery;
215
216 Object  tray "tray" server_room
217   with  description "It's a CD tray. Just like every other CD tray.",
218         name 'cd' 'tray',
219         before [;
220           Receive:
221             if (noun ~= disc)
222                 print_ret (The) noun, " is too big to fit.";
223           Open:
224             if (tray hasnt visited) {
225                 score = score + 2;
226                 give tray visited;
227             }
228         ],
229         after [;
230           Open:
231             print_ret "You press the button and the CD tray pops out.";
232           Close:
233             if (disc in self) {
234                 deadflag = 5;
235                 print_ret
236                     "^With the CD in the tray, you quickly reboot the
237                     server.^^After the bios posts, your disc starts
238                     doing its thing and before you know it the server
239                     is happily running Trisquel, and even more than
240                     that, the beeping has stopped. Yay!";
241             }
242         ],
243   has   container openable scenery;
244
245 !=========================================================================
246 ! Entry point routines
247
248 [ Initialise;
249     location = break_room;
250     "^^^^It's Saturday, a nice one at that, and you've been called in
251     to fix a server that's on the blink. Again.^^You've had it. This
252     server is going to run GNU/Linux from this day forward! The
253     process will be easy - just put the disc into the server and away
254     we go. Now where is that Trisquel CD?^";
255 ];
256
257 [ Deathmessage;
258     if (deadflag == 5)
259         print "You have won";
260 ];
261
262 !=========================================================================
263 ! Standard and Extended Grammar
264 Include "grammar";
265 !=========================================================================