Constant Story "Tommy The Toaster"; Constant Headline "^An interactive demonstration^(c) Aug 2000 by Coala^"; Constant DEBUG; Constant USE_MODULES; Include "Parser"; Include "VerbLib"; [ Initialise; location = kitchen; "Well...here you are in the kitchen, with Tommy The Toaster and Brad The Bread.^Let's see what you make of it.^^^"; ]; Object kitchen "Fairly Well Sized Kitchen" with description "As for the demonstration, there aren't that many things in here. A colorful descripiton is also missing...^The room is dominated by a huge table.", has light; Object -> table "wooden table" with name "plain" "wooden" "table", description "A plain wooden table. Pretty useful in a kitchen.", has supporter scenery; Object -> -> bread "Brad The Bread" with name "brad" "the" "bread", description [; print "A good slice of toast. "; switch(self.number) { 0: "Pretty untoasted yet."; 1: "Under the microscope, one could perhaps see faint brown spots."; 2: "Brad got a bit of tan."; 3: "Brad is really looking yummy."; 4: "Brad looks a bit too dark."; 5: "Brad is now not longer Brad The Bread but Peter Cole the Piece Of Coal."; } ], before [; Eat: if (self.number==0) "But Tommy wants desperately to toast his friend..."; ], after [; Eat: switch(self.number) { 1 to 4: deadflag=2; "Yummy!"; 5: deadflag=1; "Oh dear! The risk of getting cancer is high in these days..."; } ], number 0, has proper edible; Object -> -> toaster "Tommy The Toaster" with name "tommy" "the" "toaster", description "A pretty modern but simple toaster. It has a slot for the bread (as usual), a lever and a small dial for setting the toastedness.", number 0, before [; Receive: <>; ], daemon [ i; i=self.number; i--; self.number=i; if (i>-1) rfalse; StopDaemon(self); give lever ~general; move bread to table; "^Brad juts out of Tommy and lands on the kitchen table."; ], has proper transparent; Object -> -> -> slot "slot for the bread" with name "slot" "slot for the bread", description "A long black hole. Tommy seems not to be disturbed by it.", before [; LetGo: if (lever has general) "You can't reach Brad yet, he is still getting tanned."; Search: if (bread in self && lever has general) "Brad is getting tanned now."; ], has container open scenery; Object -> -> -> lever "lever" with name "lever", description "It is the lever for pushing down the bread and heating the toaster.", before [; Push: if (self has general) "The lever is already down."; if (bread notin slot) "Tommy awakens: ~But I got no bread in me! Save energy!~"; if (dial.number==0) "Tommy remarks: ~With toastedness set to zero, this will be a short trip for Brad The Bread!~"; give self general; toaster.number=dial.number; bread.number=bread.number+dial.number; if (bread.number>5) bread.number=5; StartDaemon(toaster); "You push down the lever, and Brad The Bread disappears in Tommy The Toaster. Slowly, the wires start to glow and Brad gets tanned."; ], has scenery; Object -> -> -> dial "toastedness dial" with name "toastedness" "dial", description [; print "A small white dial with numbers from 0 to 5 around it. Currently, it is set to ",self.number,".^"; rtrue; ], number 0, before [; SetTo: switch(second) { 0 to 5: if (self.number==second) "The dial is already set to that value."; self.number=second; print "You set the dial to ",second,".^"; rtrue; default: "You can set the dial to numbers ranging from 0 to 5."; } ], has scenery; Include "Grammar"; End;