9239799e70d900cef07e9c010be5d202e1632df0
[homeland.git] / src / homeland.inf
1 !% $OMIT_UNUSED_ROUTINES=1
2 ! Copyright (C) 2019, 2020 Jason Self <j@jxself.org>
3 !
4 ! This file is free software: you may copy, redistribute and/or
5 ! modify it under the terms of the GNU Affero General Public License
6 ! as published by the Free Software Foundation, either version 3 of
7 ! the License, or (at your option) any later version.
8 !
9 ! This file is distributed in the hope that it will be useful, but
10 ! WITHOUT ANY WARRANTY; without even the implied warranty of
11 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ! Affero General Public License for more details.
13 !
14 ! You should have received a copy of the GNU Affero General Public
15 ! License along with this file. If not, see https://gnu.org/licenses/
16 Global guardscalled = 0;
17 Constant DEATH_MENTION_UNDO;
18 Constant MAX_SCORE = 7;
19 Constant Story "Homeland";
20 Constant Headline 
21     "^A work of interactive fiction.
22     ^If you get stuck try typing HELP.
23     ^Ongoing development: https://jxself.org/git/?p=homeland.git
24     ^Send bugs and feedback by email to j@@64jxself.org.
25     ^IFID AC0898CB-0668-4853-9EB9-757958D4AF56
26     ^Copyright (C) 2019, 2020 Jason Self
27     ^You can change and share this game under the terms of the GNU 
28     Affero General Public License as published by the Free Software 
29     Foundation (FSF), either version 3 of the License, or (at your 
30     option) any later version published by the FSF. See the GNU Affero 
31     General Public License for more details.^^You should have received 
32     a copy of this game's source code along with a copy of the GNU 
33     Affero General Public License so that you can know your rights. 
34     If not, contact the place you got it from.^^";
35 Include "parser";
36 Include "verblib";
37 Release 0;
38 Serial "201027";
39 Include "src/objects/intro/kitchen.inf";
40 Include "src/objects/intro/livingroom.inf";
41 Include "src/objects/intro/bedroom.inf";
42 Include "src/objects/intro/grandlivingroom.inf";
43 Include "src/objects/intro/sidewalk.inf";
44 Include "src/objects/intro/frontporch.inf";
45 Include "src/objects/intro/neighborlivingroom.inf";
46 Include "src/objects/intro/backyard.inf";
47 Include "src/objects/intro/neighborkitchen.inf";
48
49 Include "src/objects/overworld/campsite.inf";
50 Include "src/objects/overworld/westofcampsite.inf";
51 Include "src/objects/overworld/shed.inf";
52 Include "src/objects/overworld/house.inf";
53 Include "src/objects/overworld/grandlibrary.inf";
54 Include "src/objects/overworld/g58.inf";
55 Include "src/objects/overworld/g59.inf";
56 Include "src/objects/overworld/g60.inf";
57 Include "src/objects/overworld/g77.inf";
58 Include "src/objects/overworld/g79.inf";
59 Include "src/objects/overworld/h70.inf";
60 Include "src/objects/overworld/h78.inf";
61 Include "src/objects/overworld/h80.inf";
62 Include "src/objects/overworld/h76.inf";
63
64 Include "src/objects/globals.inf";
65
66 [ DeathMessage;
67     if (deadflag == 3)
68         print "To Be Continued";
69 ];
70
71 [ PrintRank;
72     print ", earning you the rank of ";
73     if (score == 0)
74         "Novice.";
75     if (score == 1)
76         "Trained.";
77     if (score == 2)
78         "Skilled.";
79     if (score == 3)
80         "Talented.";
81     if (score == 4)
82         "Capable.";
83     if (score == 5)
84         "Adept.";
85     if (score == 6)
86         "Proficient.";
87     if (score >= 7)
88         print "Versed.";
89 ];
90
91 [ Initialise;
92     Location = kitchen;
93     print "^It happened again.^^";
94     print 
95         "While reading the morning newspaper, there was another small 
96         explosion from your neighbor's home. This time you were able 
97         to see the series of three bright blue sparks that your 
98         friends were talking about from your kitchen window through 
99         the curtains covering their living room window.^^";
100     print 
101         "You crane your neck out the window to look, but all is 
102         quiet. ~What's going on over there?~ you wonder.^^";
103     StartDaemon(machine);
104 ];
105
106 [ URL;
107     print 
108         "^If you need help try some of the commands from: 
109         ^http://pr-if.org/doc/play-if-card/^";
110 ];
111
112 [ XyzzySub;
113     print "Nothing obvious happens.^";
114     return true;
115 ];
116
117 [ HelpSub;
118     if (location == kitchen && window hasnt open) {
119         print 
120             "It might be nice to open that window and get some
121             fresh air.^";
122     }
123     if (location == kitchen && window has open) {
124         print 
125             "That window seems almost large enough to climb 
126             through.^";
127     }
128     if (location == livingroom || location == bedroom || location == 
129     sidewalk || location == frontporch && window hasnt open) {
130         print 
131             "Maybe you should go back to the kitchen and try the 
132             HELP command again.^";
133     }
134     if (location == livingroom || location == bedroom || location == 
135     sidewalk || location == frontporch && window has open) {
136         print 
137             "That window in your kitchen seems just large enough to 
138             climb through...^";
139     }
140     if (location == backyard || location == bedroom || location == frontporch || location == grandlivingroom || location == kitchen || location == livingroom || location == neighborkitchen || location == neighborlivingroom || location == sidewalk && television hasnt on && television.watch_count < 3) {
141         print "I wonder what's on TV?^";
142     }
143     if (location == backyard || location == bedroom || location == frontporch || location == grandlivingroom || location == kitchen || location == livingroom || location == neighborkitchen || location == neighborlivingroom || location == sidewalk && television has on && television.watch_count < 3) {
144         print 
145             "The TV show U.S. News And Grue Report is usually very 
146             informative.^";
147     }
148     if (location == backyard || location == bedroom || location == frontporch || location == grandlivingroom || location == kitchen || location == livingroom || location == neighborkitchen || location == neighborlivingroom || location == sidewalk && TestScope(poker)) {
149         print 
150             "The poker looks like it could make an effective 
151             weapon.^";
152     }
153     URL();
154     return true;
155 ];
156
157 Include "grammar";
158
159 Verb 'About'
160     * -> Version;
161
162 Verb 'Info'
163     * -> Version;
164
165 Verb 'Help'
166     * -> Help;
167
168 Verb 'Clue'
169     * -> Help;
170
171 Verb 'xyzzy'
172     * -> Xyzzy;
173
174 Verb 'lick' = 'eat';
175
176 Verb 'snort' = 'smell';
177
178 Verb 'jam' = 'put';
179
180 Verb 'jab' = 'put';
181
182 Verb 'stick' = 'put';
183
184 Verb 'thrust' = 'put';
185
186 Verb 'crawl'
187     * 'through' / 'out' / 'via' noun -> Go;
188
189 Verb 'escape'
190     * 'through' / 'out' / 'via' noun -> Go;
191
192 Extend 'jump'
193     * 'through' / 'out' / 'via' noun -> Go;
194
195 Extend 'climb'
196     * 'through' / 'out' / 'via' noun -> Go;
197
198 Extend 'go'
199     * 'through' / 'out' / 'via' noun -> Go;
200
201 Extend 'attack'
202     * noun 'with' noun -> Attack;