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