!========================================================================= ! MINFORM.INF ! ! This file contains 3 rooms, 5 objects and the player. ! It starts at 21K using the mInform Library. ! Recommended compiler is Inform 6.15 ! (c) 2004 by Dave Bernazzani !========================================================================= Switches e; ! Use Economize mode - abbreviations are in parser.h Constant Story "^Toy Box"; Constant Headline "^An Interactive mInform Example^"; Release 4; !Constant MINFORM_WEAR 1; ! Define MINFORM_WEAR if you want 'worn' objects (saves 500 bytes otherwise) Include "Parser"; !========================================================================= !Replacement library messages. !========================================================================= Object LibraryMessages with before [; Jump: "Nothing fruitful can be accomplished by jumping here."; ]; Include "VerbLib"; !========================================================================= !Object Classes !========================================================================= Object My_Room "My Room" with description "You are standing in your room. You can go south and a stairwell leads down.", s_to My_Room2, d_to Down_Room, has light; Object stairwell "stairwell" My_Room with name 'stairs' 'stairwell', with description "The stairs lead down.", with before [; Go, Enter: <>; ], has scenery; Object redbox "small red box" My_Room with name 'small' 'red' 'box', with description "This is a small red box.", has container openable ~open; Object LightSwitch "lightswitch" My_Room with name 'lightswitch' 'switch', with describe "There is a lightswitch nearby.", ! with describe [;print "There is a lightswitch nearby.";rtrue;], with description "This is light switch.", has switchable static ; Object robot "robot" My_Room with name 'robot', with description "A shiny new robot.", with whiz 0, each_turn [; self.whiz++; if ((self.whiz % 3 == 0) && (robot notin toybox)) { print "^The robot whizzes from one side of the room to the other, then stops.^"; } return true; ], with life [; Order: print_ret "The robot kindly responds, ~I'm sorry, but I cannot help you with that.~"; Ask: switch (second) { 'toy', 'toys': "The robot responds, ~These are my play-things.~"; 'death': deadflag=1; default: "With a child-like voice, the robot responds, ~I cannot help you with that.~"; }; Answer: switch(noun) { 'hello', 'hallo', 'hi', 'greetings': "The robot computes for a few seconds, then says, ~Hello.~"; } ], with orders [; Enter: if ((noun == toybox) && (robot notin toybox)) { move robot to toybox; "The robot makes a whiz-bang motion and goes into the toybox on your command."; } Exit, VagueGo, Go: if (robot in toybox) { move robot to My_Room; "The robot leaves the toybox and is now back in the main room."; } default: return false; ], has animate ; Object toybox "toy box" My_Room with name 'blue' 'toy' 'box' 'toybox', with description "This is a fairly large toy box.", with before [ ; Go, VagueGo, Enter: "It's a large toy box, but not that large!"; ], has container openable open static; Object toy "small toy" My_Room with name 'small' 'toy', with description "This is a small toy.", has ; Object My_Room2 "My Other Room" with description "You are standing in another room. The room you came from lies to the north.", n_to My_Room, has ; Object Down_Room "Downstairs Room" with description "You are standing below your room. You can go back up to your toy room.", u_to My_Room, cant_go "Sorry, can't go that way.", has light; Object SmallBall "small ball" Down_Room with name 'small' 'round' 'ball', with description "This is a small round ball.", with before [; Roll: "You roll the ball around for a while, then get bored."; ], with after [; Drop: print "It bounces for a good while...^"; return 2; ], has ; !========================================================================= !Subroutines !========================================================================= !========================================================================= !Entry Point Routines !========================================================================= [ Initialise; location=My_Room; score = 0; print "^^^"; "^^^Welcome to the Toy Box mInform adventure!"; ]; [RollSub; "Can't roll that!"; ]; Include "Grammar"; !========================================================================= !New and Extended Verbs go here. !========================================================================= Verb "roll" * noun -> Roll;