Inform - Resources - Examples

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing Alice3.inf

Chessboard and furniture (lines 91-304)

091  Object  red_queen "red queen"
092   has    female
093   with   name "red" "queen",
094          describe [;
095              if (white_kitten.state == QUEEN_STATE
096                  || black_kitten.state == QUEEN_STATE)
097                  rtrue;
098          ],
099          description "She's a fierce little chess piece.",
100          after [;
101           Take:
102              if (white_kitten.state == QUEEN_STATE) 
103                  white_kitten.state = CHAIR_STATE;
104              if (black_kitten.state == QUEEN_STATE) 
105                  black_kitten.state = CHAIR_STATE;
106           PutOn,Transfer,Insert:
107              if (second == chess_board)
108                  "Alone on the chess board, the red queen is monarch of
109                  all she surveys.";
110          ];
111   
112  Object  chess_board "chess board" Drawing_Room
113   has    supporter
114   with   name "chess" "board" "checker" "chequer" "chessboard",
115          initial "An abandoned chess board lies on the floor.",
116          description "It's left here from the game you were playing
117              just now, but the pieces are all missing - the kittens
118              will insist on playing with them.";
119   
120  Object  hearth "hearth" Drawing_Room
121   has    scenery
122   with   name "hearth" "fire" "place" "fireplace";
123   
124  Object  rug "rug" Drawing_Room
125   has    concealed static supporter enterable
126          ! general if you've found the red queen under it
127   with   name "hearthrug" "hearth-rug" "rug" "indian" "arabian" "beautiful"
128              "soft",
129          description "It's a beautiful rug, made in some far off
130              country, perhaps India or Araby, wherever those might
131              be.",
132          before [;
133           Take: "The rug is much too large and heavy for you to carry.";
134           Push,Pull: "But a hearth-rug is meant to be next to the
135              hearth!";
136           LookUnder:
137              if (player in mantelpiece || player in armchair)
138                  "You're unable to reach the rug from here.";
139              if (player in self)
140                  "You try to lift up a corner of the rug, but fail. After
141                  a while, you realise that this is because you are
142                  standing on it. How curious the world is!";
143              if (self hasnt general) {
144                  give self general;
145                  move red_queen to player;
146                  "You lift up a corner of the rug and, peering
147                  underneath, discover the red queen from the chess
148                  set.";
149              }
150          ];
151   
152  Object  armchair "arm-chair" Drawing_Room
153   has    static concealed supporter enterable
154          ! general if its by the mantelpiece
155   with   name "arm" "chair" "armchair" "arm-chair",
156          description [;
157              print "It's a huge arm-chair, the perfect place for a kitten
158                  or a little girl to curl up in and doze. It has been
159                  pushed over to the ";
160              if (self has general) "fireplace.";
161              "window.";
162          ],
163          before [ i;
164           Push,Pull:
165              if (player notin Drawing_Room)
166                  "You'll have to get off ", (the) parent(player), 
167                  " first.";
168              if (white_kitten in player || black_kitten in player)
169                  "Not with a kitten in your arms!";
170              if (white_kitten.state == CHAIR_STATE) i = white_kitten;
171              else if (black_kitten.state == CHAIR_STATE) i = black_kitten;
172              if (i ~= 0)
173                  "You are about to start moving the chair when you
174                  notice that ", (the) i, " is right in the way. It's a
175                  good thing you spotted it, or you would have squashed
176                  flat the poor little thing.";
177              if (self has general) {
178                  give self ~general;
179                  "You push the arm-chair away from the hearth.";
180              }
181              give self general;
182              "You push the arm-chair over to the hearth.";
183           Climb,Enter:
184              move player to armchair;
185              "You jump into the warm and comfortable arm-chair.";
186           Take: "The chair is so heavy you ca'n't carry it.";
187          ];
188   
189  Object  mantelpiece "mantelpiece" Drawing_Room
190   has    concealed supporter enterable
191   with   name "mantel" "mantelpiece",
192          description "It's higher off the ground than your head, but
193              it looks wide enough and sturdy enough to support you.",
194          before [;
195           Enter,Climb:
196              if (player notin armchair)
197                  "The mantelpiece is much too high to climb up onto.";
198              if (armchair hasnt general)
199                  "You can't reach the mantelpiece from here.";
200              if (children(player) > 0)
201                  "Your hands are too full.";
202              move player to mantelpiece;
203              "You scramble up onto the mantelpiece.";
204           PutOn,LetGo:
205              if (player notin self && (player notin armchair || 
206                  armchair hasnt general))
207                  "The mantelpiece is so high that you can't reach.";
208          ];
209   
210  Object  mirror "looking-glass" Drawing_Room
211   has    static concealed
212   with   name "mirror" "looking" "glass" "looking-glass",
213          description [;
214              if (player in mantelpiece)
215                  "Strangely, the glass is beginning to melt away,
216                  just like a bright silvery mist.";
217              if (player in armchair)
218                  "In the looking-glass you can see the drawing-room of
219                  the looking-glass house. What you can see is very
220                  much the same as this drawing-room, only all
221                  reversed, left for right. But you are sure that out
222                  of the corners of the glass, where you can't see, the
223                  looking-glass world is quite different from yours.";
224              "In the looking-glass you can see the ceiling of the
225              drawing-room of the looking-glass house. It looks much
226              the same as the ceiling of your drawing-room.";
227          ],
228          before [;
229              if (action ~= ##Examine or ##ThrownAt or ##Reflect &&
230                  player notin mantelpiece)
231                  "You can't reach the looking-glass from where you're
232                  standing.";
233           Touch,Pull,Push:
234              "Your hand goes right through the silvery mist!";
235           ThrownAt: "You don't want seven years' bad luck, do you?";
236           Enter:
237              ! Really, move Alice to the looking-glass house.
238              deadflag = 2;
239              "Your hand goes right through the silvery mist, and in
240              another moment the rest of you follows, and you are
241              through the glass...";
242          ];
243   
244  Object  worsted "ball of worsted" Drawing_Room
245          ! general if its in a tangle
246   with   name "ball" "of" "worsted" "fine" "blue" "wool",
247          describe [;
248              if (white_kitten.state ~= WOOL_STATE &&
249                  black_kitten.state ~= WOOL_STATE)
250                  "^A discarded ball of worsted lies on the floor here.";
251              rtrue;
252          ],
253          description [;
254              if (self has general)
255                  "It's in a terrible tangle. All that time you spent
256                  rolling it up, and now look at it!";
257              "It's a ball of fine blue wool, all rolled up in preparation
258              for some embroidery.";
259          ],
260          before [;
261           Untangle: 
262              give self ~general;
263              "You're as quick as can be at rolling up balls of wool,
264              though you say so yourself! Soon it's neat and tidy again.";
265          ],
266          after [;
267           Take:
268              if (white_kitten.state == WOOL_STATE) 
269                  white_kitten.state = CHAIR_STATE;
270              if (black_kitten.state == WOOL_STATE) 
271                  black_kitten.state = CHAIR_STATE;
272          ];
273   
274  Object  chess_pieces "chess pieces" Drawing_Room
275   has    scenery
276   with   parse_name [ w colour n;
277              w = NextWord();
278              if (w == 'white' or 'red') {
279                  n ++;
280                  colour = w;
281                  w = NextWord();
282              }
283              if (w == 'pawn' or 'rook' or 'castle' ||
284                  w == 'knight' or 'horse' or 'bishop' ||
285                  w == 'king' || (w == 'queen' && 
286                  (colour == 'white' || rug hasnt general))) return n + 1;
287              return 0;
288          ],
289          before [;
290              "Alas, that chess piece seems to be missing. Those
291              naughty kittens!";
292          ];
293   
294  Object  window "window" Drawing_Room
295   has    scenery
296   with   name "window" "pane",
297          description "Outside the window it's snowing gently, and you're
298              glad to be in here in the warmth.",
299          before [;
300           Open: "You wouldn't want to catch a chill, would you?  Better
301              leave the window shut.";
302           Search: <<Examine self>>;
303          ];
304   


Last updated 23 June 2004. This web site has not been fully supported since April 2008. Information may be out of date. This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.