Inform - Resources - Examples

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing Toyshop.inf

Spirit Level (lines 763-797)

763  ! >SL  Which can be put on the mantelpiece: the first time this is done, the
764  !      game randomly decides which end is higher, and sticks to this decision.
765  ! ----------------------------------------------------------------------------
766   
767  Object -> -> spirit_level "spirit level"
768    with name "spirit" "level" "wood" "flask",
769         number 0,
770         description "A length of wood containing a flask of viscous 
771             green liquid, in which a bubble is trapped.",
772         before
773         [; Examine:
774            if (spirit_level in mantelpiece)
775            {   print "The bubble is at the ";
776                if (self.number==1) "northeast end.";
777                "southeast end.";
778            } 
779         ],
780         after
781         [; PutOn: if (second~=mantelpiece) rfalse;
782             if (spirit_level hasnt general) self.number=random(2);
783             give spirit_level general; Achieved(4);
784             print "You put the spirit level on the mantelpiece, 
785                    and the bubble slowly drifts towards the ";
786             if (self.number==1) "northeast.";
787             "southwest.";
788         ];
789   
790  Object -> mantelpiece "mantelpiece"
791    with name "mantel" "mantle" "piece" "mantelpiece"
792    has  scenery supporter;
793   
794  Object -> -> key "iron key"
795    with name "iron" "key", article "an";
796   
797  ! ----------------------------------------------------------------------------


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.