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