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