Listing 1. Inform 6 Version 001 !% -SD 002 003 !========================================================================= 004 Constant Story "The Server Room"; 005 Constant Headline 006 "^An Interactive Fiction by Daniel Bartholomew.^"; 007 Release 1; Serial "080625"; !for keeping track of public releases 008 009 Constant MAX_SCORE = 6; 010 011 Include "Parser"; 012 Include "VerbLib"; 013 014 global openedbackpack = 1; 015 global openedtray = 1; 016 global takencd = 1; 017 global beeping = 1; 018 019 !========================================================================= 020 ! The Game Objects 021 022 Object break_room "Break Room" 023 with 024 description "Your standard break room. A fridge, and a long 025 counter take up one wall. East is the outside world and west 026 is the hallway to the server room.", 027 w_to hallway, 028 e_to "You take one look outside and think better of it. The 029 daystar is too bright and terrible to face today. Besides, you 030 have work to do.", 031 has light; 032 033 Object fridge "refrigerator" break_room 034 with 035 description "Your standard refrigerator.", 036 name 'fridge' 'refrigerator', 037 has container openable scenery; 038 039 Object counter "long counter" break_room 040 with 041 description "A long counter. You can't quite determine the color, 042 it's somewhere between green and brown. On the counter is a 043 microwave.", 044 name 'counter', 045 has static supporter scenery; 046 047 Object microwave "microwave" counter 048 with 049 description "Your standard microwave.", 050 name 'microwave' 'micro', 051 has container openable scenery; 052 053 Object table "Table" break_room 054 with 055 description "It's a table. Were you expecting something else?", 056 name 'table', 057 before [; 058 Take: "Let me spell it out for you: it is a T A B L E and you are 059 NOT Superman."; 060 ], 061 has supporter; 062 063 Object backpack "backpack" table 064 with 065 description "Your backpack.", 066 name 'pack' 'back' 'bag' 'backpack', article "your", 067 before [; 068 Open: 069 if (openedbackpack == 1) { 070 score = score + 2; 071 openedbackpack = 2; 072 } 073 ], 074 has clothing container openable; 075 076 Object disc "Ubuntu CD" backpack 077 with 078 description "An automatic recovery CD, guaranteed to fix almost 079 any server.^^Ok, it's just an install CD that auto-installs 080 Ubuntu, but hey, if it works, it works.", 081 name 'disk' 'disc' 'Ubuntu' 'cd', 082 after [; 083 Take: 084 if (takencd == 1) { 085 score = score + 2; 086 takencd = 2; 087 print_ret "You pick up the Ubuntu CD.^"; 088 } 089 ], 090 has ; 091 092 Object hallway "Hallway" 093 with 094 description "Bereft of features, adornment or even adequate 095 lighting, this hallway is as plain as they come. Doors lead 096 east back to the break room, north to the server room, or west 097 to the restrooms.", 098 e_to break_room, 099 n_to server_room, 100 w_to "When nature calls, you'll know about it, but right now, it 101 isn't calling.", 102 before [; 103 Go: 104 if (noun == n_obj) { 105 StartDaemon(server_room); 106 print "^^You use your key card to open the server room 107 door and step into your world.^"; 108 } 109 ], 110 has light; 111 112 Object server_room "Server Room" 113 with 114 description "The fans, the lights, the chill . . . yep, it's a 115 server room. Full of servers from a dozen different 116 manufacturers, each with their own quirks.^^Your attention is 117 immediately drawn to a server 2/3 of the way up rack 7. The 118 little indicator light is blinking red, and it is beeping.", 119 s_to hallway, 120 daemon [; 121 if (location ~= server_room) return; 122 beeping = random(7); 123 switch (beeping) { 124 1: "^The beeping is driving you crazy."; 125 2: "^It's hard to think, with all of the beeping."; 126 3: "^The monotony of the beeping is maddening."; 127 4: "^You can't stand the beeping."; 128 5: "^The beeping reminds you of your alarm clock."; 129 6: "^beep . . . beep . . . beep . . . beep . . . beep 130 . . . beep . . ."; 130 7: "^If you don't stop the beeping soon, you'll loose what 132 little hair you have left."; 133 } 134 ], 135 has light; 136 137 Object server "server" server_room 138 with 139 description "The indicator light on this ancient server is 140 blinking orange. The rest the front is featureless except for 141 the CD tray. The beeping seems to emanate from somewhere 142 inside the server.", 143 name 'server' 'machine' 'computer' 'ancient' 'old', 144 has scenery; 145 146 Object tray "tray" server_room 147 with 148 description "It's a CD tray. Just like every other CD tray.", 149 name 'cd' 'tray', 150 before [; 151 Open: 152 if (openedtray == 1) { 153 score = score + 2; 154 openedtray = 2; 155 } 156 ], 157 after [; 158 Open: 159 print_ret "You press the button and the CD tray pops out."; 160 Close: 161 if (disc in self) { 162 deadflag = 5; 163 print_ret "^With the CD in the tray, you quickly reboot 164 the server.^^After the bios posts, your disc starts 165 doing its thing and before you know it the server is 166 happily running Ubuntu, and even more than that, the 167 beeping has stopped. Yay!"; 168 } 169 ], 170 has container openable scenery; 171 172 !========================================================================= 173 ! Entry point routines 174 175 [ Initialise; 176 location = break_room; 177 "^^^^It's Saturday, a nice one at that, and you've been called in to 178 fix a server that's on the blink. Again.^^You've had it. This 179 server is going to run Linux from this day forward! The process 180 will be easy - just put the disc into the server and away we go. 181 Now where is that Ubuntu CD?^"; 182 ]; 183 184 [ Deathmessage; 185 if (deadflag == 5) print "You have won"; 186 ]; 187 188 !========================================================================= 189 ! Standard and Extended Grammar 190 191 Include "Grammar"; 192 193 !=========================================================================