Update to serial 200329
[homeland.git] / src / objects / intro / neighborlivingroom.inf
1 ! Copyright (C) 2019 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
16 Object  neighborlivingroom "Neighbor's Livingroom"
17   with  description 
18             "You are in your neighbor's livingroom. It seems that no 
19             one has lived here in a long time, even though you saw 
20             your neighbor here last week. All of the furniture has 
21             been removed and the air smells stale. A large bay window 
22             enclosed by sheer cobalt blue curtains allowing light to 
23             come through. There's another room to the north. A door is 
24             to the east.^^A machine as tall as you sits in the center 
25             of their livingroom. It consists of three transparent 
26             spheres joined together containing machinery. A barrel 
27             with a small aperture comes out of the farthest sphere, 
28             pointing down and to the wall. The entire thing rests on 
29             a shiny metal platform allowing it to rotate and tilt with 
30             ease.",
31         w_to neighborkitchen,
32         e_to neighbordoor,
33         n_to grandlivingroom,
34         before [;
35           Go:
36             if (bluebutton has on && poker notin machine) {
37                 machine.shoot();
38                 rtrue;
39             }
40         ],
41   has   light;
42
43 Object  neighborwindow "window" neighborlivingroom
44   with  name 'large' 'bay' 'window' 'windows',
45         description "A large bay window enclosed by sheer cobalt blue 
46                     curtains allowing light to come through.",
47         before [;
48           Go:
49             print_ret "The window is not something you can go through.";
50           Open, Close:
51             print_ret "This isn't the type of window that can be 
52                       opened or closed.";
53         ],
54   has   scenery;
55
56 Object  neighborcurtains "curtains" neighborlivingroom
57   with  name 'cobalt' 'blue' 'curtain' 'curtains',
58         description 
59             "Cobalt blue in color, the curtains have been decorated with 
60             intricate embroidery.",
61         before [;
62           Take, Pull, Push, PushDir:
63             print_ret "Don't you think they look nice where they are?";
64         ],
65   has   scenery openable pluralname;
66
67 Object  embroidery "embroidery" neighborlivingroom
68   with  name 'embroidery' 'pattern' 'patterns',
69   has   scenery;
70
71 Object  redbutton "red button" neighborlivingroom
72   with  name 'red' 'red button' 'button' 'buttons',
73         before [;
74           Push:
75             if (bluebutton has on && poker notin machine) {
76                 print 
77                     "You reach for the red button, but not in 
78                     time...^ ";
79                 machine.shoot();
80                 rtrue;
81             }
82             if (poker in machine)
83                 print_ret 
84                     "You press the red button but it's futile because 
85                     the machine's shorted out.";
86             else {
87                 print 
88                     "You push the red button. The machine makes clunky 
89                     noises as machinery moves inside. A loud humming 
90                     begins to emanate from it. It comes to life, spins 
91                     around on its base, aims, and quickly fires a 
92                     series of three bright blue sparks at you. You 
93                     hear a small explosive sound as they impact your 
94                     chest. You feel a little disoriented as it 
95                     teleports you away.^";
96                 PlayerTo(campsite);
97                 rtrue;
98             }
99         ],
100   has   scenery;
101
102 Object  bluebutton "blue button" neighborlivingroom
103   with  name 'blue' 'blue button' 'button' 'buttons',
104         before [;
105           Push:
106             if (bluebutton has on) {
107                 if (poker notin machine) {
108                     print 
109                         "You reach for the blue button, but not 
110                         in time...^ ";
111                     machine.shoot();
112                     rtrue;
113                 }
114                 else {
115                     give bluebutton ~on;
116                     print_ret "You push the blue button. The machine 
117                     sounds like it powers down.";
118                 }
119             }
120             else {
121                 give bluebutton on;
122                 if (poker notin machine) {
123                     machine.shoot();
124                     rtrue;
125                 }
126                 print_ret "You push the blue button.";
127             }
128         ],
129   has   scenery on;
130
131 Object  machine "machine" neighborlivingroom
132   with  name 'machine' 'machinery' 'sphere' 'spheres' 'platform' 'barrel'
133         'aperture' 'metal platform' 'shiny metal platform' 'shiny platform'
134         'shiny' 'metal',
135         description 
136             "It consists of three transparent spheres joined together 
137             containing machinery. A barrel with a small aperture comes 
138             out of the farthest sphere, pointing down and to the wall. 
139             The entire thing rests on a shiny metal platform allowing 
140             it to rotate and tilt with ease. There is a blue button 
141             and a red button.",
142         time_left,
143         before [ weapon;
144           Attack:
145             if (noun == self)
146                 weapon = second;
147             else
148                 weapon = noun;
149             if (weapon ~= poker) {
150                 print "That wasn't helpful.^";
151                 if (bluebutton has on)
152                     self.shoot();
153                 rtrue;
154             }
155             self.shortout();
156             return true;
157           Receive:
158             if (noun == poker) {
159                 self.shortout();
160                 return true;
161             }
162             if (bluebutton has on)
163                 self.shoot();
164             rtrue;
165         ],
166         time_out [;
167             if (poker in self)
168                 StopTimer(machine);
169             else
170                 if (bluebutton has on)
171                     self.shoot();
172         ],
173         daemon [;
174             if (poker in player)
175                 rfalse;
176             if (player in parent(self) && poker notin machine)
177                 self.shoot();
178         ],
179         shoot [ destination;
180             destination = random(3);
181             print 
182                 "^A loud humming begins to emanate from the machine. 
183                 It comes to life, spins around on its base, aims, and 
184                 quickly fires a series of three bright blue sparks at 
185                 you. You hear a small explosive sound as they impact 
186                 your chest. You feel a little disoriented as it 
187                 teleports you away.^";
188             if (destination == 1)
189                 PlayerTo(kitchen);
190             if (destination == 2)
191                 PlayerTo(livingroom);
192             if (destination == 3)
193                 PlayerTo(bedroom);
194         ],
195         shortout [;
196             if (machine hasnt visited) {
197                 score = score + 1;
198                 give machine visited;
199             }
200             move poker to self;
201             print "You put the poker into ", (the) self, 
202                 ". Sparks 
203                 fly wildly in every direction as it shorts out.^";
204         ],
205   has   scenery container open;