Inform - Resources - Examples

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing Toyshop.inf

White Candles (lines 341-384)

341  ! >WC  A box of eight candles.
342  !
343  !      This is a simple way to code up duplicate objects.  For one thing,
344  !      > take candles
345  !      does not quite behave as we would hope: it'll only pick up one candle
346  !      (though "> take four candles" will work).  See the "Block" class
347  !      below for a way to make good.
348  !
349  !      If we had needed a much greater number of candles, we could have used
350  !      object creation and destruction during play.  See the "Ticket" class
351  !      from the "Balances" example game.
352  ! ----------------------------------------------------------------------------
353   
354  Class  Candle
355    with name "wax" "candle" "candles",
356         short_name "wax candle", plural "wax candles",
357         description "It looks just like all the other candles.",
358         before
359         [; Burn: "Disappointingly, the wick refuses to burn."; ];
360   
361  Object -> "grey tin box"
362    with name "tin" "box" "grey",
363         description
364             "A grey tin box of ~Major's Candles~.",
365    has  container openable;
366   
367  Candle -> ->;
368  Candle -> ->;
369  Candle -> ->;
370  Candle -> ->;
371  Candle -> ->;
372  Candle -> ->;
373  Candle -> ->;
374  Candle -> ->;
375   
376  Toyroom East_End "East End"
377    with name "dolls" "nurses",
378         description
379            "The eastern end of the toyshop is pink, and dolls and 
380             nurses line the shelves right up to the high window. 
381             A dark doorway leads to a northern side chamber.",
382         w_to Toyshop, n_to DarkRoom;
383   
384  ! ----------------------------------------------------------------------------


Last updated 23 June 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.