Update to serial 210401
[snowed-in.git] / src / snowed-in.inf
1 ! Copyright (C) 2021 Jason Self <j@jxself.org>
2 !
3 ! This file is free software: you may copy, redistribute and/or
4 ! modify it under the terms of the GNU Affero General Public License
5 ! as published by the Free Software Foundation, either version 3 of
6 ! the License, or (at your option) any later version.
7 !
8 ! This file is distributed in the hope that it will be useful, but
9 ! WITHOUT ANY WARRANTY; without even the implied warranty of
10 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ! Affero General Public License for more details.
12 !
13 ! You should have received a copy of the GNU Affero General Public
14 ! License along with this file. If not, see https://gnu.org/licenses/
15 Constant DEATH_MENTION_UNDO;
16 Constant Story "Snowed In";
17 Constant Headline 
18     "^A work of interactive fiction.
19     ^If you get stuck try typing HELP.
20     ^Ongoing development: https://jxself.org/git/?p=snowed-in.git
21     ^Send bugs and feedback by email to j@@64jxself.org.
22     ^IFID DE9FA2E5-4EC7-4166-9218-E56EFA1DF40F
23     ^Copyright (C) 2021 Jason Self
24     ^You can change and share this game under the terms of the GNU 
25     Affero General Public License as published by the Free Software 
26     Foundation (FSF), either version 3 of the License, or (at your 
27     option) any later version published by the FSF. See the GNU Affero 
28     General Public License for more details.^^You should have received 
29     a copy of this game's source code along with a copy of the GNU 
30     Affero General Public License so that you can know your rights. 
31     If not, contact the place you got it from.^^";
32 Include "parser";
33 Include "verblib";
34 Release 0;
35 Serial "210401";
36
37 Object  mainroom "Main Room"
38   with  description 
39             "This room is a total wreck - it looks like a major fight 
40             happened in here. There's a ripped up sofa and a broken 
41             old coffee table in the middle of the room. A flat-screen 
42             TV is mounted against the wall, with the screen dangling 
43             out. Tis cabin has three other rooms. There's an office 
44             area with a desk and computer to the east. There's a 
45             bedroom to the north and a kitchenette to the west. 
46             There's a doorway in the south wall leading outside.",
47         e_to office,
48   has   light;
49
50 Object  sofa "sofa" mainroom
51   with  name 'sofa' 'couch',
52   with  description 
53             "The sofa is in poor shape. The upholstery is ripped and 
54             there are several holes in it.",
55         before [;
56           Take, Pull, Push, PushDir, Turn:
57             print_ret (The) self, " is too heavy for that.";
58         ],
59   has   scenery supporter enterable;
60
61 Object  coffeetable "coffee table" mainroom
62   with  name 'coffee' 'table',
63   with  description 
64             "The old coffee table looks as if it's had quite a bit 
65             of use. There are burn marks covering it and the paint is 
66             worn off in most places.",
67         before [;
68           Take, Pull, Push, PushDir, Turn:
69             print_ret (The) self, " is too heavy for that.";
70         ],
71   has   scenery supporter enterable;
72
73 Object  television "flat-screen TV" mainroom
74   with  name 'TV' 'television' 'flat' 'screen' 'flat-screen',
75   with  description 
76             "The flat-screen TV looks fairly modern but it's 
77             been broken in a fight and the screen is dangling out.",
78         before [;
79           Take, Pull, Push, PushDir, Turn:
80             print_ret (The) self, " is firmly mounted to the wall.";
81           SwitchOn:
82             if (television hasnt visited) {
83                 print 
84                     "Despite the significant damage, the television 
85                     comes to life in one last valiant attempt to be 
86                     useful. Your favorite news program is on: U.S. 
87                     News And Grue Report. The news anchor is giving a 
88                     warning of Grue sightings in the area of the 
89                     forest before the television finally dies.^";
90                 give television visited;
91             }
92             else {
93                 print 
94                     "The flat-screen TV is broken and can't be 
95                     turned on.^";
96             }
97             return true;
98         ],
99   has   scenery switchable;
100
101 Object  lightsocket "light socket" mainroom
102   with  name 'light' 'socket' 'lightsocket',
103         before [;
104           Take, Pull, Push, PushDir, Turn:
105             print_ret 
106                 "You don't have the tools to remove a light 
107                 socket.";
108           Receive:
109             if (noun ~= lightbulb) {
110                 print "Put ";
111                 print (a) noun;
112                 print_ret 
113                     " into the light socket? Maybe you should come with a
114                     warning label because you contain more than a trace
115                     amount of nut.";
116             }
117             if (noun == lightbulb) {
118                 give mainroom light;
119                 give office light;
120             }
121         ],
122   has   scenery container transparent open;
123
124 Object  lightbulb "light bulb" lightsocket
125   with  name 'light' 'bulb' 'lightbulb',
126         after [;
127           Take, Pull, Push, PushDir, Turn:
128             give mainroom ~light;
129             give office ~light;
130         ];
131
132 Object  office "Office"
133   with  description 
134             "There seems to have been quite a fight in here. The room 
135             is a wreck. Holes are in the walls and the windows are 
136             broken, letting in the cold air from outside. Chunks of 
137             drywall and insulation cover the floor. The desk has a 
138             bullet hole through the middle.",
139         w_to mainroom,
140   has   light;
141
142 Object  desk "solid oak desk" office
143   with  name 'solid' 'oak' 'desk',
144   with  description 
145             "The desk is old and made of solid oak. The right side of 
146             it has been smashed and all of the drawers have been 
147             removed. A bullet hole goes straight through the middle of 
148             the desk.",
149         before [;
150           Take, Pull, Push, PushDir, Turn:
151             print_ret (The) self, " is too heavy for that.";
152         ],
153   has   scenery supporter enterable;
154
155 Object  businesscard "business card" desk
156   with  name 'business' 'card',
157   with  description 
158             "The business card is white and has blacked edges. It 
159             bears the name ~Lasting Solutions~, a local data recovery 
160             company, in bold letters on the top. The company's 
161             website URL is printed in blue at the bottom.";
162
163 Object  salesreceipt "sales receipt" desk
164   with  name 'sales' 'receipt',
165   with  description 
166             "The sales receipt is for $200, dated three years ago. 
167             It's printed on old tractor feed printer paper and bears 
168             the name ~Lasting Solutions~, a local data recovery 
169             company. A handwritten note is scrawled on the bottom: 
170             ~Start working on these hard drives soon.~";
171
172 Object  computer "computer" desk
173   with  name 'computer' 'PC',
174   with  description 
175             "It's a heavy older model that appears to have been 
176             seriously damaged in a fight. It's clearly on its last 
177             legs but is perhaps still useful.",
178         before [;
179           Take, Pull, Push, PushDir, Turn:
180             print_ret (The) self, " is too heavy for that.";
181           SwitchOn:
182             if (computer hasnt visited) {
183                 print 
184                     "The computer makes some concerning noises while 
185                     lights on the front also illuminate. The last 
186                     file is quickly displayed. ~If anyone else reads 
187                     this, you're in serious danger. I've been fighting 
188                     a ferocious grue for the last three days. I'm 
189                     almost out of supplies and can't last much 
190                     longer. I'm going to take the last of the supplies 
191                     and escape through the office window in a 
192                     last-ditch effort to get away and get back into 
193                     town. I hope I can make it.~ The computer then 
194                     makes a sickly sound and finally dies as some 
195                     smoke comes out of it.^";
196                 give computer visited;
197             }
198             else {
199                 print 
200                     "The display briefly flickers but nothing 
201                     else happens.^";
202             }
203             return true;
204         ],
205   has   switchable;
206
207 [ Initialise;
208     Location = mainroom;
209     thedark.description = 
210         "It is pitch black. You are likely to be eaten 
211         by a grue.";
212     print 
213         "You're trapped in a snowstorm while visiting the forest 
214         during your vacation to a small rural town. This is the worst 
215         snowstorm in more than 40 years. If only you has listened to 
216         the news. Well, it's too late for that. The snow has been 
217         falling for the past seven hours and shows no signs of 
218         stopping anytime soon. You need to get back to your hotel in 
219         the town. You finally manage to find an old cabin in the 
220         woods and get inside but have no idea where you are. You're 
221         not dressed for this weather.^";
222 ];
223
224 [ InScope;
225     if (location == thedark && real_location == mainroom) {
226         PlaceInScope(lightsocket);
227     }
228     return false;
229 ];
230
231 Object  grue "grue" thedark
232   with  article "the",
233         name 'grue' 'monster',
234         each_turn [;
235             StartDaemon(self);
236         ],
237         turns_active,
238         daemon [;
239             if (location ~= thedark) {
240                 self.turns_active = 0;
241                 StopDaemon(self);
242                 rtrue;
243             }
244             switch (++(self.turns_active)) {
245               1:
246                 "^You hear horrible gurgling sounds in the dark.";
247               2:
248                 "^You hear the clink of razor-sharp claws nearby.";
249               3:
250                 deadflag = true;
251                 "^Your last memory is of the slavering fangs of the 
252                 horrible Grue as it claims you for a meal.";
253             }
254         ],
255   has   scenery;
256
257 [ DarkToDark;
258     deadflag = 1;
259     "Oh, no! You have walked into the slavering fangs of a lurking 
260     grue!";
261 ];
262
263 [ URL;
264     print 
265         "^If you need help try some of the commands from: 
266         ^http://pr-if.org/doc/play-if-card/^";
267 ];
268
269 [ XyzzySub;
270     print "Nothing obvious happens.^";
271     return true;
272 ];
273
274 [ HelpSub;
275     URL();
276     return true;
277 ];
278
279 Include "grammar";
280
281 Verb 'About'
282     * -> Version;
283
284 Verb 'Info'
285     * -> Version;
286
287 Verb 'Help'
288     * -> Help;
289
290 Verb 'Clue'
291     * -> Help;
292
293 Verb 'Hint'
294     * -> Help;
295
296 Verb 'xyzzy'
297     * -> Xyzzy;