Add key card
[the-server-room.git] / the-server-room.inf
1 !% -SD
2 !=========================================================================
3 ! Copyright (C) 2019, 2020 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 "201027";
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         before [;
75           SwitchOn:
76             print_ret
77                 "The television can only be turned on using the
78                 remote.";
79         ],
80   has   container openable scenery switchable;
81
82 Object  whitecouch "white couch" break_room
83   with  description
84             "With a smooth and modern design, this looks to be a luxurious couch.
85             It is extremely durable and easy to clean and maintain. Offering
86             enough room to sit or lay, it looks very soft and comfortable.",
87         name 'white' 'couch' 'sofa',
88         before [;
89           Take, Pull, Push, PushDir:
90             print_ret (The) self, " is too heavy for that.";
91         ],
92   has   scenery static supporter enterable;
93
94 Object  posters "posters" break_room
95   with  description
96             "Fold outs from a japanese sport fanzine, the posters
97             really show off the players and game.",
98         name 'sport' 'sports' 'poster' 'posters',
99   has   scenery;
100
101 Object  fridge "refrigerator" break_room
102   with  description
103             "This refrigerator makes a statement with a sleek, modern
104             and minimal stainless steel design. Featuring large doors
105             it seems quite an impressive refrigerator that can hold a
106             lot.",
107         name 'fridge' 'refrigerator',
108   has   container openable scenery;
109
110 Object  counter "long counter" break_room
111   with  description
112             "It's a beautiful, stylish, and high-quality solid wood
113             counter that runs the length of the wall. You can't quite
114             determine the color of the sleek countertop, it's
115             somewhere between green and brown. The design on the
116             countertop consists of geometric patterns. It seems a
117             sturdy, durable, and solid counter.",
118         name 'counter',
119   has   static supporter scenery;
120
121 Object  microwave "microwave" counter
122   with  description
123             "A combination of silver and black, this microwave looks
124             like a real workhorse. It's compact, quiet, and works
125             great.",
126         name 'microwave' 'micro',
127         before [;
128           Receive:
129             print "Put ";
130             print (a) noun;
131             print_ret
132                 " into the microwave? Maybe you should come with a
133                 warning label because you contain more than a trace
134                 amount of nut.";
135         ],
136   has   container openable;
137
138 Object  table "table" break_room
139   with  description "The table is made of strong wood. It looks to 
140                     be about 6 feet across and could probably sit 6 
141                     to 8 people. It's white, round and seems very 
142                     functional as a table despite looking quite 
143                     heavy.",
144         name 'table',
145         before [;
146           Take:
147             "Let me spell it out for you: it is a T A B L E and you
148             are NOT Superman.";
149         ],
150   has   scenery supporter;
151
152 Object  backpack "backpack" table
153   with  description
154             "This backpack looks like a modern art piece that was
155             made using brown and light blue-green watercolors. A black
156             line was traced around to make the stitching lines.
157             Well-worn and quite suitable for travel, it looks like it
158             could carry a lot of belongings.",
159         name 'pack' 'back' 'bag' 'backpack',
160         article "your",
161         before [;
162           Open:
163             if (backpack hasnt visited) {
164                 score = score + 2;
165                 give backpack visited;
166             }
167         ],
168   has   clothing container openable;
169
170 Object  disc "Trisquel CD" backpack
171   with  description
172             "An automatic recovery CD, guaranteed to fix almost any
173             server.^^Ok, it's just an install CD that auto-installs
174             Trisquel, but hey, if it works, it works.",
175         name 'disk' 'disc' 'Trisquel' 'cd',
176         after [;
177           Take:
178             if (disc hasnt visited) {
179                 score = score + 2;
180                 give disc visited;
181             }
182         ],
183   has   ;
184
185 Object  hallway "Hallway"
186   with  description
187             "Bereft of features, adornment or even adequate lighting,
188             this hallway is as plain as they come. Doors lead east
189             back to the break room, north to the server room, or
190             west to the restrooms.",
191         e_to break_room,
192         n_to
193             "You use your key card to open the server room door but
194             instead of a beep of approval and an unlocked door you
195             get a buzz of denial and the door remains locked. Plus:
196             Through the window in the door you can see someone moving
197             around inside but there shouldn't be anyone else here
198             today.",
199         w_to restroom,
200   has   light;
201
202 Object  keycard "key card" break_room
203   with  description
204             "The key card is thin and black with a magnetic strip 
205             down the middle. The company logo is laser-etched into 
206             the plastic on one side. The card is slightly bendable 
207             and easy to grip.",
208         name 'key' 'card' 'keycard',
209   has   ;
210
211 Object  restroom "Restroom"
212   with  description
213             "This average-sized, square restroom has a sink set into a
214             resin counter. The floor is tiled, the ceiling has
215             removable tiles, and the walls are painted with a
216             wallpapered dado. Light is provided by ceiling lights. The
217             room is done in colors that remind you of the sky and
218             overall looks very eclectic.",
219         e_to hallway,
220   has   light;
221
222 Object  server_room "Server Room"
223   with  description
224             "The fans, the lights, the chill . . . yep, it's a server
225             room. Full of servers from a dozen different
226             manufacturers, each with their own quirks.^^Your
227             attention is immediately drawn to a server 2/3 of the way
228             up rack 7. The little indicator light is blinking red, and
229             it is beeping.",
230         s_to hallway,
231         each_turn [;
232             beeping = random(7);
233             switch (beeping) {
234               1:
235                 "^The beeping is driving you crazy.";
236               2:
237                 "^It's hard to think, with all of the beeping.";
238               3:
239                 "^The monotony of the beeping is maddening.";
240               4:
241                 "^You can't stand the beeping.";
242               5:
243                 "^The beeping reminds you of your alarm clock.";
244               6:
245                 "^beep . . . beep . . . beep . . . beep . . . beep
246                 . . . beep . . .";
247               7:
248                 "^If you don't stop the beeping soon, you'll loose
249                 what little hair you have left.";
250             }
251         ],
252   has   light;
253
254 Object  server "server" server_room
255   with  description
256             "The indicator light on this ancient server is blinking
257             orange. The rest the front is featureless except for the
258             CD tray. The beeping seems to emanate from somewhere
259             inside the server.",
260         name 'server' 'machine' 'computer' 'ancient' 'old',
261   has   scenery;
262
263 Object  tray "tray" server_room
264   with  description "It's a CD tray. Just like every other CD tray.",
265         name 'cd' 'tray',
266         before [;
267           Receive:
268             if (noun ~= disc)
269                 print_ret (The) noun, " is too big to fit.";
270           Open:
271             if (tray hasnt visited) {
272                 score = score + 2;
273                 give tray visited;
274             }
275         ],
276         after [;
277           Open:
278             print_ret "You press the button and the CD tray pops out.";
279           Close:
280             if (disc in self) {
281                 deadflag = 5;
282                 print_ret
283                     "^With the CD in the tray, you quickly reboot the
284                     server.^^After the bios posts, your disc starts
285                     doing its thing and before you know it the server
286                     is happily running Trisquel, and even more than
287                     that, the beeping has stopped. Yay!";
288             }
289         ],
290   has   container openable scenery;
291
292 !=========================================================================
293 ! Entry point routines
294
295 [ Initialise;
296     location = break_room;
297     move keycard to player;
298     "^^^^It's Saturday, a nice one at that, and you've been called in
299     to fix a server that's on the blink. Again.^^You've had it. This
300     server is going to run GNU/Linux from this day forward! The
301     process will be easy - just put the disc into the server and away
302     we go. Now where is that Trisquel CD?^";
303 ];
304
305 [ Deathmessage;
306     if (deadflag == 5)
307         print "You have won";
308 ];
309
310 !=========================================================================
311 ! Standard and Extended Grammar
312 Include "grammar";
313 !=========================================================================