e69a9f0d98ece8abf7070ce9ab2829f687d0c8d4
[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 "200604";
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
52 [ DeathMessage;
53     if (deadflag == 3)
54         print "To Be Continued";
55 ];
56
57 [ PrintRank;
58     print ", earning you the rank of ";
59     if (score == 0)
60         "Novice.";
61     if (score == 1)
62         "Trained.";
63     if (score == 2)
64         "Skilled.";
65     if (score == 3)
66         "Talented.";
67     if (score == 4)
68         "Capable.";
69     if (score == 5)
70         "Adept.";
71     if (score == 6)
72         "Proficient.";
73     if (score >= 7)
74         print "Versed.";
75 ];
76
77 [ Initialise;
78     Location = Kitchen;
79     print "^It happened again.^^";
80     print 
81         "While reading the morning newspaper, there was another small 
82         explosion from your neighbor's home. This time you were able 
83         to see the series of three bright blue sparks that your 
84         friends were talking about from your kitchen window through 
85         the curtains covering their living room window.^^";
86     print 
87         "You crane your neck out the window to look, but all is 
88         quiet. ~What's going on over there?~ you wonder.^^";
89     StartDaemon(machine);
90 ];
91
92 [ URL;
93     print 
94         "^If you need help try some of the commands from: 
95         ^http://pr-if.org/doc/play-if-card/^";
96 ];
97
98 [ XyzzySub;
99     print "Nothing obvious happens.^";
100     return true;
101 ];
102
103 [ HelpSub;
104     if (location == kitchen && window hasnt open) {
105         print 
106             "It might be nice to open that window and get some
107             fresh air.^";
108     }
109     if (location == kitchen && window has open) {
110         print 
111             "That window seems almost large enough to climb 
112             through.^";
113     }
114     if (location == livingroom || location == bedroom || location == 
115     sidewalk || location == frontporch && window hasnt open) {
116         print 
117             "Maybe you should go back to the kitchen and try the 
118             HELP command again.^";
119     }
120     if (location == livingroom || location == bedroom || location == 
121     sidewalk || location == frontporch && window has open) {
122         print 
123             "That window in your kitchen seems just large enough to 
124             climb through...^";
125     }
126     if (television hasnt on && television.watch_count < 3) {
127         print "I wonder what's on TV?^";
128     }
129     if (television has on && television.watch_count < 3) {
130         print 
131             "The TV show U.S. News And Grue Report is usually very 
132             informative.^";
133     }
134     if (TestScope(poker)) {
135         print 
136             "The poker looks like it could make an effective 
137             weapon.^";
138     }
139     URL();
140     return true;
141 ];
142
143 Include "grammar";
144
145 Verb 'About'
146     * -> Version;
147
148 Verb 'Info'
149     * -> Version;
150
151 Verb 'Help'
152     * -> Help;
153
154 Verb 'Clue'
155     * -> Help;
156
157 Verb 'xyzzy'
158     * -> Xyzzy;
159
160 Verb 'lick' = 'eat';
161
162 Verb 'snort' = 'smell';
163
164 Verb 'jam' = 'put';
165
166 Verb 'jab' = 'put';
167
168 Verb 'stick' = 'put';
169
170 Verb 'thrust' = 'put';
171
172 Verb 'crawl'
173     * 'through' / 'out' / 'via' noun -> Go;
174
175 Verb 'escape'
176     * 'through' / 'out' / 'via' noun -> Go;
177
178 Extend 'jump'
179     * 'through' / 'out' / 'via' noun -> Go;
180
181 Extend 'climb'
182     * 'through' / 'out' / 'via' noun -> Go;
183
184 Extend 'go'
185     * 'through' / 'out' / 'via' noun -> Go;
186
187 Extend 'attack'
188     * noun 'with' noun -> Attack;