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