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