Deny access to the server room from the hallway
[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 openedbackpack = 1;
46 Global openedtray = 1;
47 Global takencd = 1;
48 Global beeping = 1;
49 !=========================================================================
50 ! The Game Objects
51
52 Object  break_room "Break Room"
53   with  description
54             "Your standard break room. A fridge, and a long counter
55             take up one wall. East is the outside world and west is
56             the hallway to the server room.",
57         w_to hallway,
58         e_to
59             "You take one look outside and think better of it. The
60             daystar is too bright and terrible to face today. Besides,
61             you have work to do.",
62   has   light;
63
64 Object  fridge "refrigerator" break_room
65   with  description
66             "This refrigerator makes a statement with a sleek, modern
67             and minimal stainless steel design. Featuring large doors
68             it seems quite an impressive refrigerator that can hold a
69             lot.",
70         name 'fridge' 'refrigerator',
71   has   container openable scenery;
72
73 Object  counter "long counter" break_room
74   with  description
75             "A long counter. You can't quite determine the color,
76             it's somewhere between green and brown. On the counter is
77             a microwave.",
78         name 'counter',
79   has   static supporter scenery;
80
81 Object  microwave "microwave" counter
82   with  description
83             "A combination of silver and black, this microwave looks
84             like a real workhorse. It's compact, quiet, and works
85             great.",
86         name 'microwave' 'micro',
87   has   container openable scenery;
88
89 Object  table "table" break_room
90   with  description "It's a table. Were you expecting something else?",
91         name 'table',
92         before [;
93           Take:
94             "Let me spell it out for you: it is a T A B L E and you
95             are NOT Superman.";
96         ],
97   has   supporter;
98
99 Object  backpack "backpack" table
100   with  description
101             "This backpack looks like a modern art piece that was
102             made using brown and light blue-green watercolors. A black
103             line was traced around to make the stitching lines.
104             Well-worn and quite suitable for travel, it looks like it
105             could carry a lot of belongings.",
106         name 'pack' 'back' 'bag' 'backpack',
107         article "your",
108         before [;
109           Open:
110             if (openedbackpack == 1) {
111                 score = score + 2;
112                 openedbackpack = 2;
113             }
114         ],
115   has   clothing container openable;
116
117 Object  disc "Trisquel CD" backpack
118   with  description
119             "An automatic recovery CD, guaranteed to fix almost any
120             server.^^Ok, it's just an install CD that auto-installs
121             Trisquel, but hey, if it works, it works.",
122         name 'disk' 'disc' 'Trisquel' 'cd',
123         after [;
124           Take:
125             if (takencd == 1) {
126                 score = score + 2;
127                 takencd = 2;
128                 print_ret "You pick up the Trisquel CD.^";
129             }
130         ],
131   has   ;
132
133 Object  hallway "Hallway"
134   with  description
135             "Bereft of features, adornment or even adequate lighting,
136             this hallway is as plain as they come. Doors lead east
137             back to the break room, north to the server room, or
138             west to the restrooms.",
139         e_to break_room,
140         n_to
141             "You use your key card to open the server room door but
142             instead of a beep of approval and an unlocked door you
143             get a buzz of denial and the door remains locked. Plus:
144             Through the window in the door you can see someone moving
145             around inside but there shouldn't be anyone else here
146             today.",
147         w_to
148             "When nature calls, you'll know about it, but right now,
149             it isn't calling.",
150   has   light;
151
152 Object  server_room "Server Room"
153   with  description
154             "The fans, the lights, the chill . . . yep, it's a server
155             room. Full of servers from a dozen different
156             manufacturers, each with their own quirks.^^Your
157             attention is immediately drawn to a server 2/3 of the way
158             up rack 7. The little indicator light is blinking red, and
159             it is beeping.",
160         s_to hallway,
161         each_turn [;
162             beeping = random(7);
163             switch (beeping) {
164               1:
165                 "^The beeping is driving you crazy.";
166               2:
167                 "^It's hard to think, with all of the beeping.";
168               3:
169                 "^The monotony of the beeping is maddening.";
170               4:
171                 "^You can't stand the beeping.";
172               5:
173                 "^The beeping reminds you of your alarm clock.";
174               6:
175                 "^beep . . . beep . . . beep . . . beep . . . beep
176                 . . . beep . . .";
177               7:
178                 "^If you don't stop the beeping soon, you'll loose
179                 what little hair you have left.";
180             }
181         ],
182   has   light;
183
184 Object  server "server" server_room
185   with  description
186             "The indicator light on this ancient server is blinking
187             orange. The rest the front is featureless except for the
188             CD tray. The beeping seems to emanate from somewhere
189             inside the server.",
190         name 'server' 'machine' 'computer' 'ancient' 'old',
191   has   scenery;
192
193 Object  tray "tray" server_room
194   with  description "It's a CD tray. Just like every other CD tray.",
195         name 'cd' 'tray',
196         before [;
197           Receive:
198             if (noun ~= disc)
199                 print_ret (The) noun, " is too big to fit.";
200           Open:
201             if (openedtray == 1) {
202                 score = score + 2;
203                 openedtray = 2;
204             }
205         ],
206         after [;
207           Open:
208             print_ret "You press the button and the CD tray pops out.";
209           Close:
210             if (disc in self) {
211                 deadflag = 5;
212                 print_ret
213                     "^With the CD in the tray, you quickly reboot the
214                     server.^^After the bios posts, your disc starts
215                     doing its thing and before you know it the server
216                     is happily running Trisquel, and even more than
217                     that, the beeping has stopped. Yay!";
218             }
219         ],
220   has   container openable scenery;
221
222 !=========================================================================
223 ! Entry point routines
224
225 [ Initialise;
226     location = break_room;
227     "^^^^It's Saturday, a nice one at that, and you've been called in
228     to fix a server that's on the blink. Again.^^You've had it. This
229     server is going to run GNU/Linux from this day forward! The
230     process will be easy - just put the disc into the server and away
231     we go. Now where is that Trisquel CD?^";
232 ];
233
234 [ Deathmessage;
235     if (deadflag == 5)
236         print "You have won";
237 ];
238
239 !=========================================================================
240 ! Standard and Extended Grammar
241 Include "grammar";
242 !=========================================================================